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

updates for integrated setup and coupled run of LADAS #81

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
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
70 changes: 70 additions & 0 deletions GEOSldas_App/GEOSldas_HISTdet.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#
# Sample GEOSldas HISTORY.rc file for LADAS (central simulation)
#
# This sample is for the GEOSldas instance that is coupled with the central
# simulation component of the Hy4dEnVar ADAS:
#
# (1) The "catch_progn_incr" is output is the ensemble average.
# (2) The "catch_progn_incr" output is in tile space. Its definition is generic
#
##################################################################################

VERSION: 1
EXPID: GEOSldas_expid

COLLECTIONS:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add the usual diagnostic tavg[*]_2d_lnd_Nx, and inst[*]_2d_lndfcstana_Nx collections that we will want to output from the LDAS whenever it's running in the coupled land-atm DA system.

The time step could be hourly (as in FP and reanalysis) or perhaps 3-hourly (as in SMAP L4).

Note that the aforementioned collection names are from the MERRA-2 era and reflect what is in FP now. For M21C, there's slightly different naming convention. I assume the newer convention will be adopted in FP when it transitions to the forthcoming "v12" (181-level) GCM, so maybe it's best to use the newer collection naming convention here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those diag collections can be added to the template. Because they are lat/lon outputs, more modification is needed in setup, we will need to insert the grid name ( from setup info) in the specification of "regrid_name", probably a corresponding "grid_label" as well.

'catch_progn_incr'
::

GRID_LABELS: PC720x361-DC
PC576x361-DC
::

PC720x361-DC.GRID_TYPE: LatLon
PC720x361-DC.IM_WORLD: 720
PC720x361-DC.JM_WORLD: 361
PC720x361-DC.POLE: PC
PC720x361-DC.DATELINE: DC
PC720x361-DC.LM: 1

PC576x361-DC.GRID_TYPE: LatLon
PC576x361-DC.IM_WORLD: 576
PC576x361-DC.JM_WORLD: 361
PC576x361-DC.POLE: PC
PC576x361-DC.DATELINE: DC
PC576x361-DC.LM: 1


catch_progn_incr.descr: 'Tile-space,3-Hourly,Instantaneous,Single-Level,Assimilation,Ensemble-Average Land Prognostics Increments',
catch_progn_incr.template: '%y4%m2%d2_%h2%n2z.bin',
catch_progn_incr.mode: 'instantaneous',
catch_progn_incr.frequency: 030000,
catch_progn_incr.ref_time: 013000,
catch_progn_incr.fields: 'TCFSAT_INCR' , 'LANDASSIM' ,
'TCFTRN_INCR' , 'LANDASSIM' ,
'TCFWLT_INCR' , 'LANDASSIM' ,
'QCFSAT_INCR' , 'LANDASSIM' ,
'QCFTRN_INCR' , 'LANDASSIM' ,
'QCFWLT_INCR' , 'LANDASSIM' ,
'CAPAC_INCR' , 'LANDASSIM' ,
'CATDEF_INCR' , 'LANDASSIM' ,
'RZEXC_INCR' , 'LANDASSIM' ,
'SRFEXC_INCR' , 'LANDASSIM' ,
'GHTCNT1_INCR' , 'LANDASSIM' ,
'GHTCNT2_INCR' , 'LANDASSIM' ,
'GHTCNT3_INCR' , 'LANDASSIM' ,
'GHTCNT4_INCR' , 'LANDASSIM' ,
'GHTCNT5_INCR' , 'LANDASSIM' ,
'GHTCNT6_INCR' , 'LANDASSIM' ,
'WESNN1_INCR' , 'LANDASSIM' ,
'WESNN2_INCR' , 'LANDASSIM' ,
'WESNN3_INCR' , 'LANDASSIM' ,
'HTSNNN1_INCR' , 'LANDASSIM' ,
'HTSNNN2_INCR' , 'LANDASSIM' ,
'HTSNNN3_INCR' , 'LANDASSIM' ,
'SNDZN1_INCR' , 'LANDASSIM' ,
'SNDZN2_INCR' , 'LANDASSIM' ,
'SNDZN3_INCR' , 'LANDASSIM' ,
::

# ========================== EOF ==============================================
1,083 changes: 1,083 additions & 0 deletions GEOSldas_App/GEOSldas_HISTens.rc

Large diffs are not rendered by default.

54 changes: 45 additions & 9 deletions GEOSldas_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class LDASsetup:
exphome_ = cmdLineArgs['exphome'].rstrip('/')
assert os.path.isdir(exphome_) # exphome should exist
self.exphome = os.path.abspath(exphome_)
self.nymdb = cmdLineArgs['nymdb']
self.nhmsb = cmdLineArgs['nhmsb']
self.verbose = cmdLineArgs['verbose']
self.runmodel = cmdLineArgs['runmodel']
if self.runmodel :
Expand Down Expand Up @@ -153,6 +155,9 @@ class LDASsetup:

for key in rqdExeInpKeys :
assert key in self.rqdExeInp,' "%s" is required in the input file %s' % (key,self.exeinpfile)
if cmdLineArgs['nymdb'] != 'None' and cmdLineArgs['nhmsb'] != 'None' :
self.date = f"{self.nymdb} {self.nhmsb}"
self.rqdExeInp[ 'BEG_DATE' ] = self.date

# print rqd exe inputs
if self.verbose:
Expand All @@ -167,9 +172,17 @@ class LDASsetup:
_mydir = None
self.ladas_coupling = int(self.rqdExeInp.get('LADAS_COUPLING',0))
self.adas_expdir =''
if self.ladas_coupling > 0:
assert 'ADAS_EXPDIR' in self.rqdExeInp, " need ADAS_EXPDIR in the input file %s" %(self.exeinpfile)
self.adas_expdir = self.rqdExeInp['ADAS_EXPDIR']
if self.ladas_coupling > 0 :
self.adas_expdir = os.path.dirname(self.exphome)
self.rqdExeInp[ 'ADAS_EXPDIR'] = self.adas_expdir
self.adas_expid = os.path.basename(self.adas_expdir)
self.rqdExeInp[ 'MET_TAG' ] = self.adas_expid + '__bkg'
if self.ladas_coupling == 1 :
self.rqdExeInp[ 'EXP_ID' ] = self.adas_expid + '_LDAS'
if self.ladas_coupling == 2 :
self.rqdExeInp[ 'EXP_ID' ] = self.adas_expid + '_LDAS4ens'
self.rqdExeInp[ 'MET_PATH' ] = self.adas_expdir +'/atmens/mem'

self.first_ens_id = int(self.rqdExeInp.get('FIRST_ENS_ID',0))
self.perturb = int(self.rqdExeInp.get('PERTURBATIONS',0))
if self.nens > 1:
Expand Down Expand Up @@ -1079,7 +1092,7 @@ class LDASsetup:

# DEFAULT rc files
default_rc = glob.glob(etcdir+'/GEOSldas_*.rc')
assert len(default_rc)==4
assert len(default_rc)==6
print (default_rc)
for rcfile in default_rc:
shortfile=rcfile.rsplit('GEOSldas_',1)[1]
Expand Down Expand Up @@ -1112,6 +1125,21 @@ class LDASsetup:
sp.call(shlex.split(cmd))
for line in fileinput.input(tmprcfile,inplace=True):
print (line.rstrip().replace('GEOSldas_expid',self.rqdExeInp['EXP_ID']))

# take HISTdet or HISTens if ladas
if shortfile =='HISTdet.rc' and self.ladas_coupling == 1 :
tmprcfile=self.rundir+'/HISTORY.rc'
histrc_file=rcfile
shutil.copy2(rcfile, tmprcfile)
for line in fileinput.input(tmprcfile,inplace=True):
print (line.rstrip().replace('GEOSldas_expid',self.rqdExeInp['EXP_ID']))
if shortfile =='HISTens.rc' and self.ladas_coupling == 2 :
tmprcfile=self.rundir+'/HISTORY.rc'
histrc_file=rcfile
shutil.copy2(rcfile, tmprcfile)
for line in fileinput.input(tmprcfile,inplace=True):
print (line.rstrip().replace('GEOSldas_expid',self.rqdExeInp['EXP_ID']))

# just copy an empty ExtData.rc
if shortfile=='ExtData.rc' :
shutil.copy2(rcfile, self.rundir+'/'+shortfile)
Expand Down Expand Up @@ -1553,14 +1581,12 @@ def _printExeInputKeys(rqdExeInpKeys):
print ('# #')
print ('# (2) EXP_DOMAIN must be global CS grid as in ADAS exp #')
print ('# #')
print ('# (3) MET_TAG must be set to [ADAS_EXPID]__Nx+- #')
print ('# (3) MET_TAG must be set to [ADAS_EXPID]__bkg #')
print ('# MET_PATH must be set as follows for #')
print ('# LADAS_COUPLING = 1: #')
print ('# [full_path]/[LDAS_EXPID]/scratch/ #')
print ('# ../../../../recycle/holdpredout/ #')
print ('# LADAS_COUPLING = 2: #')
print ('# [ADAS_EXPDIR]/atmens/ensdiag/forc #')
print ('# After ldas exp setup, verify the following link: #')
print ('# ../input/met_forcing/forc -> [MET_PATH] #')
print ('# [ADAS_EXPDIR]/atmens/mem #')
print ('# #')
print ('# (4) BCS_PATH must be consistent with that of #')
print ('# [ADAS_EXPDIR][/run/lnbcs #')
Expand Down Expand Up @@ -1710,6 +1736,16 @@ def parseCmdLine():
help='replace computing/sponsor account in batinp file',
type=str, default='None'
)
p_setup.add_argument(
'--nymdb',
help='replaces BEG_DATE date in exeinp file ',
type=str, default='None'
)
p_setup.add_argument(
'--nhmsb',
help='replaces BEG_DATE time in exeinp file ',
type=str, default='None'
)
p_setup.add_argument(
'--runmodel',
help='Obsolete.',
Expand Down
5 changes: 0 additions & 5 deletions GEOSldas_App/lenkf_j_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@
setenv GRID $forcgrid
$GEOSBIN/enpert_forc.csh
cd $SCRDIR
else

# move central-simulation forcing held in met_forcing to scratch dir
echo "move lfo_Nx+- met forcing from $EXPDIR/input/met_forcing to $SCRDIR"
/bin/mv $EXPDIR/input/met_forcing/*lfo_Nx+-*nc4 $SCRDIR/.

endif
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
#
##############################################################################

NUM_LDAS_ENSEMBLE: [NUM_ATM_ENSEMBLE]
# e.g., ATMENS_AGCM_GRID = CF0090x6C
EXP_DOMAIN: [ATMENS_AGCM_GRID]_GLOBAL

NUM_LDAS_ENSEMBLE: [NUM_ATMENS_ENSEMBLE]

LADAS_COUPLING: 2

ADAS_EXPDIR: [full_path]/[ADAS_EXPDIR]

MET_TAG: [ADAS_EXPID]__Nx+-
MET_PATH: [ADAS_EXPDIR]/atmens/ensdiag/mem
MET_TAG: [ADAS_EXPID]__bkg
MET_PATH: [ADAS_EXPDIR]/atmens/mem

MET_HINTERP: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
#
##############################################################################

# e.g., CENTRAL_AGCM_GRID = CF0360x6C
EXP_DOMAIN: [CENTRAL_AGCM_GRID]_GLOBAL

LADAS_COUPLING: 1

ADAS_EXPDIR: [full_path]/[ADAS_EXPDIR]

MET_TAG: [ADAS_EXPID]__Nx+-
MET_PATH: ../../scratch
MET_TAG: [ADAS_EXPID]__bkg
MET_PATH: ../../../../recycle/holdpredout
# option to use perturbed forcing created from central simulation and atm ensemble
# MET_PATH: [ADAS_EXPDIR]/atmens/rgdlfo

Expand Down
24 changes: 12 additions & 12 deletions GEOSldas_App/util/config/rewind_GEOSldas.csh
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,24 @@ while ($inens <= $NENS)

if ($inens < 10) then
set ENSDIR = `echo ens000${inens}`
set catin = `echo catch000${inens}`
set pertin = `echo landpert000${inens}`
set seedin = `echo obspertrseed000${inens}`
set catin = `echo catch_e000${inens}`
set pertin = `echo landpert_e000${inens}`
set seedin = `echo obspertrseed_e000${inens}`
else if($inens < 100) then
set ENSDIR = `echo ens00${inens}`
set catin = `echo catch00${inens}`
set pertin = `echo landpert00${inens}`
set seedin = `echo obspertrseed00${inens}`
set catin = `echo catch_e00${inens}`
set pertin = `echo landpert_e00${inens}`
set seedin = `echo obspertrseed_e00${inens}`
else if($inens < 1000) then
set ENSDIR = `echo ens0${inens}`
set catin = `echo catch0${inens}`
set pertin = `echo landpert0${inens}`
set seedin = `echo obspertrseed0${inens}`
set catin = `echo catch_e0${inens}`
set pertin = `echo landpert_e0${inens}`
set seedin = `echo obspertrseed_e0${inens}`
else
set ENSDIR = `echo ens${inens}`
set catin = `echo catch${inens}`
set pertin = `echo landpert${inens}`
set seedin = `echo obspertrseed${inens}`
set catin = `echo catch_e${inens}`
set pertin = `echo landpert_e${inens}`
set seedin = `echo obspertrseed_e${inens}`
endif

/bin/ln -s ${rsout}/${ENSDIR}/Y${yin}/M${min}/${expid}.catch_internal_rst.${date} ${catin}_internal_rst
Expand Down
Loading
Loading