@@ -261,19 +261,6 @@ class LDASsetup:
261261 _hours = int (self .rqdExeInp ['JOB_SGMT' ][ 9 :11 ])
262262 _end_date = _beg_date + timedelta (hours = int (self .varwindow )/ 60 )
263263 self .rqdExeInp ['END_DATE' ] = _end_date .strftime ("%Y%m%d %H%M%S" )
264-
265- # process LDAS special nml input files
266- # FOR NOW, DEFINE/CREATE etc AND run DIRECTORIES HERE; NOTE THAT self.rundir IS DEFINED
267- # IN __init__() BELOW AND etcdir IS DEFINED IN createRCFiles().
268- current_directory = os .path .dirname (__file__ )
269- _etcdir = current_directory .rsplit ('/' ,2 )[0 ] + '/etc/'
270- _rundir = self .exphome + '/' + self .rqdExeInp ['EXP_ID' ] + '/run/'
271- self ._mkdir_p (_rundir )
272- # copy nml files to run directory
273- shutil .copy (_etcdir + '/LDASsa_SPECIAL_inputs_ensprop.nml' , _rundir )
274- shutil .copy (_etcdir + '/LDASsa_SPECIAL_inputs_ensupd.nml' , _rundir )
275- # edit resolution info in ensupd nml file
276- sp .run (['sed' , '-i' , 's/<CFnnnn>/' + _agcm_res + '/g' , _rundir + '/LDASsa_SPECIAL_inputs_ensupd.nml' ])
277264
278265 # end if self.ladas_cpl > 0 --------------------------------------------------------------------
279266
@@ -1249,15 +1236,22 @@ class LDASsetup:
12491236 for nmlfile in default_nml :
12501237 shortfile = self .rundir + '/' + nmlfile .split ('/' )[- 1 ]
12511238 shutil .copy2 (nmlfile , shortfile )
1252- # special nml
1253- if self .ladas_cpl == 0 :
1254- special_nml = []
1255- if 'NML_INPUT_PATH' in self .rqdExeInp :
1239+ # special nml
1240+ special_nml = []
1241+ if self .ladas_cpl > 0 :
1242+ special_nml = glob .glob (etcdir + '/LDASsa_SPECIAL_inputs_*.nml' )
1243+ else :
1244+ if 'NML_INPUT_PATH' in self .rqdExeInp :
12561245 special_nml = glob .glob (self .rqdExeInp ['NML_INPUT_PATH' ]+ '/LDASsa_SPECIAL_inputs_*.nml' )
1257- for nmlfile in special_nml :
1258- shortfile = nmlfile .split ('/' )[- 1 ]
1259- shutil .copy2 (nmlfile , self .rundir + '/' + shortfile )
12601246
1247+ for nmlfile in special_nml :
1248+ shortfile = self .rundir + '/' + nmlfile .split ('/' )[- 1 ]
1249+ shutil .copy2 (nmlfile , shortfile )
1250+
1251+ if self .ladas_cpl > 0 :
1252+ # edit resolution info in ensupd nml file
1253+ sp .run (['sed' , '-i' , 's/<CFnnnn>/' + self .agcm_res + '/g' , self .rundir + '/LDASsa_SPECIAL_inputs_ensupd.nml' ])
1254+
12611255 # get optimzed NX and IMS
12621256 optimized_distribution_file = tempfile .NamedTemporaryFile (delete = False )
12631257 print ("Optimizing... decomposition of processes.... \n " )
0 commit comments