Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSTPROC_HIST fix; change EXPDIR to absolute path #42

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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