Skip to content

Commit d65e5e6

Browse files
committed
Additional bug fixe for run_ccam.py postprocessing
1 parent fd4fdef commit d65e5e6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

run_ccam.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ def check_inargs():
261261
d['mlevs'] = d['mlevs'].replace(',', ', ')
262262
d['tlevs'] = d['tlevs'].replace(',', ', ')
263263
d['dlevs'] = d['dlevs'].replace(',', ', ')
264+
265+
# default value for year
266+
d['iyr'] = d['iys']
267+
d['imth'] = d['ims']
264268

265269

266270
def create_directories():
@@ -335,17 +339,17 @@ def create_directories():
335339
def restart_flag():
336340
"Create restart.qm containing flag for restart. This flag signifies that CCAM completed previous month"
337341

338-
sdate = d['iyr']*100 + d['imth']
342+
cdate = d['iyr']*100 + d['imth']
339343
edate = d['iye']*100 + d['ime']
340344

341345
if d['dmode'] == "postprocess":
342-
if sdate > edate:
346+
if cdate > edate:
343347
print("Reached end of postprocessing time-period")
344348
write2file(d['hdir']+'/restart5.qm', "Complete", mode='w+')
345349
else:
346350
write2file(d['hdir']+'/restart5.qm', "True", mode='w+')
347351
else:
348-
if sdate > edate:
352+
if cdate > edate:
349353
print("Reached end of simulation time-period")
350354
write2file(d['hdir']+'/restart.qm', "Complete", mode='w+')
351355
sys.exit(0)
@@ -1733,12 +1737,16 @@ def set_postprocess_options(fname):
17331737
if inv_schmidt == 1.:
17341738
if d['minlat'] == -999.:
17351739
d['minlat'] = -90.
1740+
print(dict2str("-> Adjust minlat to {minlat}"))
17361741
if d['maxlat'] == -999.:
17371742
d['maxlat'] = 90.
1743+
print(dict2str("-> Adjust maxlat to {maxlat}"))
17381744
if d['minlon'] == -999.:
17391745
d['minlon'] = 0.
1746+
print(dict2str("-> Adjust minlon to {minlon}"))
17401747
if d['maxlon'] == -999.:
17411748
d['maxlon'] = 360.
1749+
print(dict2str("-> Adjust maxlon to {maxlon}"))
17421750

17431751
# Replace undefined postprocess output with global settings
17441752
res = d['reqres']

0 commit comments

Comments
 (0)