Skip to content

Commit

Permalink
POSTPROC_HIST fix; change EXPDIR to absolute path #42
Browse files Browse the repository at this point in the history
  • Loading branch information
gmao-rreichle committed May 17, 2024
2 parents c4f0df5 + 971dc38 commit ad5ceb3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Changed EXPDIR to absolute path for POSTPROC_HIST>0 option to work

### Removed

- Remove restart options F and G
Expand Down
26 changes: 11 additions & 15 deletions GEOSldas_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ class LDASsetup:
# Instance variables
self.exeinpfile = cmdLineArgs['exeinpfile']
self.batinpfile = cmdLineArgs['batinpfile']
self.exphome = cmdLineArgs['exphome'].rstrip('/')
assert os.path.isdir(self.exphome) # exphome should exist
exphome_ = cmdLineArgs['exphome'].rstrip('/')
assert os.path.isdir(exphome_) # exphome should exist
self.exphome = os.path.abspath(exphome_)
self.verbose = cmdLineArgs['verbose']
self.runmodel = cmdLineArgs['runmodel']
if self.runmodel :
Expand Down Expand Up @@ -507,21 +508,17 @@ class LDASsetup:
tmp_execfyl= self.blddir+exefyl
assert os.path.isfile(tmp_execfyl),\
'Executable [%s] does not exist!' % tmp_execfyl
tmp_expid = self.rqdExeInp['EXP_ID']
tmp_expdir = os.path.abspath(self.exphome + '/' + self.rqdExeInp['EXP_ID'])
self.rundir = tmp_expdir + '/run'
self.inpdir = tmp_expdir + '/input'
self.outdir = tmp_expdir + '/output'
self.scratchdir = tmp_expdir + '/scratch'
self.blddirLn = tmp_expdir + '/build'
self.expdir = self.exphome + '/' + self.rqdExeInp['EXP_ID']
self.rundir = self.expdir + '/run'
self.inpdir = self.expdir + '/input'
self.outdir = self.expdir + '/output'
self.scratchdir = self.expdir + '/scratch'
self.blddirLn = self.expdir + '/build'
self.out_path = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']
self.bcsdir = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']+'/rc_out/'
self.rstdir = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']+'/rs/'
self.exefyl = self.blddirLn+exefyl

tmp_expid = None
tmp_expdir = None

my_ntasks_per_node = int(self.rqdRmInp['ntasks-per-node'])

# default number of nodes
Expand Down Expand Up @@ -1385,15 +1382,14 @@ class LDASsetup:
MY_LADAS_COUPLING = str(self.ladas_coupling),
MY_ENSEMBLE_FORCING= self.rqdExeInp.get('ENSEMBLE_FORCING', 'NO').upper(),
MY_ADAS_EXPDIR = self.adas_expdir,
MY_EXPDIR = self.exphome + '/' + self.rqdExeInp['EXP_ID']
MY_EXPDIR = self.expdir
)

with open('lenkf.j','wt') as fout :
fout.write(lenkf_str)
sp.call(['chmod', '755', 'lenkf.j'])

expdir = '/'.join(self.rundir.rstrip('/').split('/')[:-1])
print ('\nExperiment directory: %s' % expdir)
print ('\nExperiment directory: %s' % self.expdir)
print ()
status = True
return status
Expand Down
2 changes: 1 addition & 1 deletion GEOSldas_App/lenkf_j_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@
endif
end # each collection
cd $PWD
end # each month
cd $PWD
endif # POSTPROC_HIST > 0
#######################################################################
Expand Down

0 comments on commit ad5ceb3

Please sign in to comment.