Skip to content

Commit

Permalink
change ldas_setup for ensemble forcing
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Jan 31, 2022
1 parent c11f4f2 commit ce872fb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/Applications/LDAS_App/GEOSldas_LDAS.rc
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,7 @@ MAPL_ENABLE_BOOTSTRAP: NO
#----- Write restart or checkpoint by oserver
#
WRITE_RESTART_BY_OSERVER: NO

#----- Ensemble forcing
# MET_PATH should not contain the ensemble IDs. Default is NO
ENSEMBLE_FORCING: NO
27 changes: 20 additions & 7 deletions src/Applications/LDAS_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,26 @@ class LDASsetup:
os.symlink(self.blddir, self.blddirLn)

# met forcing dir
if 'MET_PATH' in self.rqdExeInp:
metpath = self.rqdExeInp['MET_PATH'].rstrip('/')
myMetDir = self.inpdir + '/met_forcing'
myMetPath = myMetDir + '/' + metpath.split('/')[-1]
os.symlink(metpath, myMetPath)
# update 'met_path' to use relative path from outdir
self.rqdExeInp['MET_PATH'] = os.path.relpath(myMetPath, self.rundir)
self.ensemble_forcing = True if self.rqdExeInp.get('ENSEMBLE_FORCING', 'NO').upper() == 'YES' else False

myMetPath =''
for _i in range(1, _nens+1) :
if (_nens == 1 or not self.ensemble_forcing):
str_ens = ''
else:
str_ens = '%03d'%(_i)
metpath = self.rqdExeInp['MET_PATH'].rstrip('/')+str_ens
myMetDir = self.inpdir + '/met_forcing'
myMetPath = myMetDir + '/' + metpath.split('/')[-1]
os.symlink(metpath, myMetPath)
# update 'met_path' to use relative path from outdir
if ( not self.ensemble_forcing):
break
if ( _nens !=1 and self.ensemble_forcing) :
# replace last three character with '%s"
self.rqdExeInp['MET_PATH'] = os.path.relpath(myMetPath, self.rundir)[:-3]+'%s'
else:
self.rqdExeInp['MET_PATH'] = os.path.relpath(myMetPath, self.rundir)

# update tile file
tile= self.rqdExeInp['TILING_FILE']
Expand Down
1 change: 1 addition & 0 deletions src/Components/GEOSldas_GridComp/GEOS_LdasGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ subroutine SetServices(gc, rc)

do i=1,NUM_ENSEMBLE
ens_id(i) = i-1 + FIRST_ENS_ID ! id start form FIRST_ENS_ID
ens_id(i) = ens_id(i)+1 ! ensemble forcing is starting with 1 ( 1 off with GEOSldas)

This comment has been minimized.

Copy link
@gmao-rreichle

gmao-rreichle Jan 31, 2022

Contributor

@weiyuan-jiang, @saraqzhang:
I don't think this is correct. When the LDAS is running together with the ADAS in the larger "LADAS" (land-atm DA system), the LDAS configuration should use FIRST_ENS_ID=1. If the latter is set correctly, this line doesn't make sense.

if(NUM_ENSEMBLE == 1 .or. .not. ensemble_forcing) then
id_string=''
else
Expand Down

0 comments on commit ce872fb

Please sign in to comment.