Skip to content

Commit

Permalink
dev: add a/eCO2 transient run compatibility to ensemble
Browse files Browse the repository at this point in the history
  • Loading branch information
walkeranthonyp committed Apr 21, 2022
1 parent 263e284 commit a9ac364
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
scripts/
temp/
plots/
UQ_output/
srcmods*
run_logs_archive/

Expand Down
19 changes: 13 additions & 6 deletions ensemble_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,25 @@
finidat_file_orig = orig_dir+'/'+finidat_file_orig[2:]
#get finidat files from previous ensemble cases if available
if (('1850' in casename or 'CROP' in casename) and not ('ad_spinup' in casename) and not \
('trans' in casename)):
('trans' in casename or '20TR' in casename)):
finidat_file_path = os.path.abspath(options.runroot)+'/UQ/'+casename.replace('1850CNP','1850CN')+'_ad_spinup/g'+gst[1:]
if (os.path.exists(finidat_file_path)):
finidat_file_orig = finidat_file_path+'/*.'+options.model_name+'.r.*.nc'
os.system('python adjust_restart.py --rundir '+finidat_file_path+' --casename '+ \
casename.replace('1850CNP','1850CN')+'_ad_spinup')
if ('20TR' in casename):
finidat_file_path = os.path.abspath(options.runroot)+'/UQ/'+casename.replace('20TR','1850')+ \
'/g'+gst[1:]
if (os.path.exists(finidat_file_path)):
finidat_file_orig = finidat_file_path+'/*.'+options.model_name+'.r.*.nc'
os.system('rm '+finidat_file_path+'/*ad_spinup*.'+options.model_name+'.r.*.nc')
if ( not ('CO2' in casename)):
finidat_file_path = os.path.abspath(options.runroot)+'/UQ/'+casename.replace('20TR','1850')+ \
'/g'+gst[1:]
if (os.path.exists(finidat_file_path)):
finidat_file_orig = finidat_file_path+'/*.'+options.model_name+'.r.*.nc'
os.system('rm '+finidat_file_path+'/*ad_spinup*.'+options.model_name+'.r.*.nc')
else:
finidat_file_path = os.path.abspath(options.runroot)+'/UQ/'+casename[:-5]+ \
'/g'+gst[1:]
if (os.path.exists(finidat_file_path)):
finidat_file_orig = finidat_file_path+'/*.'+options.model_name+'.r.*.nc'
os.system('rm '+finidat_file_path+'/*1850*.'+options.model_name+'.r.*.nc')
if ('trans' in casename):
finidat_file_path = os.path.abspath(options.runroot)+'/UQ/'+casename.replace('_trans','')+ \
'/g'+gst[1:]
Expand Down
2 changes: 1 addition & 1 deletion ensemble_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def putvar(fname, varname, varvals):

isfirstcase=False

#--------- code to post-process ensebmle member and cacluate total normalized SSE ----------
#--------- code to post-process ensemble member and cacluate total normalized SSE ----------
sse=0
myoutput = open('myoutput_sse.txt','w')
myind = 0
Expand Down
4 changes: 4 additions & 0 deletions site_fullrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,10 @@ def submit(fname, submit_type='qsub', job_depend=''):
else:
cases.append(basecase+'_'+modelst.replace('1850','20TR'))

if (options.eco2_file):
cases.append(basecase+'_'+modelst.replace('1850','20TR')+'_aCO2')
cases.append(basecase+'_'+modelst.replace('1850','20TR')+'_eCO2')

job_depend_run=''
if (len(cases) > 1 and options.constraints != ''):
cases=[] #QPSO will run all cases
Expand Down

0 comments on commit a9ac364

Please sign in to comment.