Commit e425949d authored by Peters, Wouter's avatar Peters, Wouter
Browse files

updated to properly process last time step

parent ce382ad7
......@@ -124,7 +124,7 @@ def save_weekly_avg_1x1_data(dacycle, statevector):
if prior:
qual_short = 'prior'
for n in range(nlag, 0, -1):
priordate = enddate - timedelta(dt.days * n)
priordate = startdate + n*dt - timedelta(dt.days * n)
savedir = dacycle['dir.output'].replace(startdate.strftime('%Y%m%d'), priordate.strftime('%Y%m%d'))
filename = os.path.join(savedir, 'savestate_%s.nc' % priordate.strftime('%Y%m%d'))
if os.path.exists(filename):
......@@ -317,6 +317,7 @@ def save_weekly_avg_state_data(dacycle, statevector):
qual_short = 'prior'
for n in range(nlag, 0, -1):
priordate = enddate - timedelta(dt.days * n)
priordate = startdate + n*dt - timedelta(dt.days * n)
savedir = dacycle['dir.output'].replace(startdate.strftime('%Y%m%d'), priordate.strftime('%Y%m%d'))
filename = os.path.join(savedir,'savestate_%s.nc' % priordate.strftime('%Y%m%d'))
if os.path.exists(filename):
......@@ -1095,7 +1096,7 @@ if __name__ == "__main__":
statevector = CO2StateVector()
statevector.setup(dacycle)
while dacycle['time.end'] < dacycle['time.finish']:
while dacycle['time.start'] < dacycle['time.finish']:
save_weekly_avg_1x1_data(dacycle, statevector)
save_weekly_avg_state_data(dacycle, statevector)
save_weekly_avg_tc_data(dacycle, statevector)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment