Skip to content

Commit

Permalink
Add Early Cycle EnKF workflow (#1022)
Browse files Browse the repository at this point in the history
Updates workflow to allow early cycle EnKF.

Refs: #1021
  • Loading branch information
XianwuXue-NOAA authored Oct 31, 2022
1 parent 52100d2 commit c5fc2b7
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 43 deletions.
4 changes: 2 additions & 2 deletions jobs/JGDAS_ENKF_ECEN
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fi
export OPREFIX="${CDUMP}.t${cyc}z."
export APREFIX="${CDUMP}.t${cyc}z."
export APREFIX_ENKF="${CDUMP_ENKF}.t${cyc}z."
export GPREFIX="${CDUMP}.t${gcyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export GSUFFIX=${GSUFFIX:-$SUFFIX}
export ASUFFIX=${ASUFFIX:-$SUFFIX}

Expand All @@ -96,7 +96,7 @@ fi
export COMIN="$ROTDIR/$CDUMP.$PDY/$cyc/$COMPONENT"
export COMIN_ENS="$ROTDIR/enkf$CDUMP_ENKF.$PDY/$cyc/$COMPONENT"
export COMOUT_ENS="$ROTDIR/enkf$CDUMP.$PDY/$cyc/$COMPONENT"
export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT"
export COMIN_GES_ENS="$ROTDIR/enkf$GDUMP.$gPDY/$gcyc/$COMPONENT"


###############################################################
Expand Down
2 changes: 1 addition & 1 deletion jobs/JGDAS_ENKF_FCST
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export pgmerr=errfile
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gdas"}}
export COMPONENT=${COMPONENT:-atmos}

export rCDUMP="gdas"

##############################################
# Begin JOB SPECIFIC work
Expand Down
6 changes: 3 additions & 3 deletions jobs/JGDAS_ENKF_SFC
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fi
export OPREFIX="${CDUMP}.t${cyc}z."
export APREFIX="${CDUMP}.t${cyc}z."
export APREFIX_ENKF="${CDUMP_ENKF}.t${cyc}z."
export GPREFIX="${CDUMP}.t${gcyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export GSUFFIX=${GSUFFIX:-$SUFFIX}
export ASUFFIX=${ASUFFIX:-$SUFFIX}

Expand All @@ -94,10 +94,10 @@ fi

# COMIN, COMIN_ENS and COMIN_GES_ENS are used in script
export COMIN="$ROTDIR/$CDUMP.$PDY/$cyc/$COMPONENT"
export COMIN_GES="$ROTDIR/$CDUMP.$gPDY/$gcyc/$COMPONENT"
export COMIN_GES="$ROTDIR/$GDUMP.$gPDY/$gcyc/$COMPONENT"
export COMIN_ENS="$ROTDIR/enkf$CDUMP_ENKF.$PDY/$cyc/$COMPONENT"
export COMOUT_ENS="$ROTDIR/enkf$CDUMP.$PDY/$cyc/$COMPONENT"
export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT"
export COMIN_GES_ENS="$ROTDIR/enkf$GDUMP.$gPDY/$gcyc/$COMPONENT"


###############################################################
Expand Down
2 changes: 1 addition & 1 deletion parm/config/config.anal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ "$CDUMP" = "gfs" ]] ; then
export USE_RADSTAT="NO" # This can be only used when bias correction is not-zero.
export GENDIAG="NO"
export SETUP='diag_rad=.false.,diag_pcp=.false.,diag_conv=.false.,diag_ozone=.false.,write_diag(3)=.false.,niter(2)=100,'
export DIAG_TARBALL="NO"
export DIAG_TARBALL="YES"
fi

export npe_gsi=$npe_anal
Expand Down
8 changes: 2 additions & 6 deletions ush/calcanl_gfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ def calcanl_gfs(DoIAU, l4DEnsVar, Write4Danl, ComOut, APrefix, ASuffix,
print('calcanl_gfs beginning at: ',datetime.datetime.utcnow())

IAUHH = IAUHrs
if Cdump == "gfs":
IAUHH = list(map(int,'6'))
else:
IAUHH = IAUHrs

######## copy and link files
if DoIAU and l4DEnsVar and Write4Danl:
Expand All @@ -40,7 +36,7 @@ def calcanl_gfs(DoIAU, l4DEnsVar, Write4Danl, ComOut, APrefix, ASuffix,
gsi_utils.link_file(RunDir+'/siganl', CalcAnlDir+'/anl.06')
gsi_utils.copy_file(ExecChgresInc, CalcAnlDir+'/chgres_inc.x')
# for ensemble res analysis
if Cdump == "gdas":
if Cdump in ["gdas", "gfs"]:
CalcAnlDir = RunDir+'/calcanl_ensres_'+format(fh, '02')
if not os.path.exists(CalcAnlDir):
gsi_utils.make_dir(CalcAnlDir)
Expand Down Expand Up @@ -304,7 +300,7 @@ def calcanl_gfs(DoIAU, l4DEnsVar, Write4Danl, ComOut, APrefix, ASuffix,


######## compute determinstic analysis on ensemble resolution
if Cdump == "gdas":
if Cdump in ["gdas", "gfs"]:
chgres_jobs = []
for fh in IAUHH:
# first check to see if guess file exists
Expand Down
4 changes: 2 additions & 2 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ FV3_GFS_predet(){
print_freq=${print_freq:-6}

#-------------------------------------------------------
if [ $CDUMP = "gfs" -a $rst_invt1 -gt 0 ]; then
if [ $CDUMP = "gfs" ] && [ $rst_invt1 -gt 0 ] && [ $MEMBER -lt 0 ]; then
RSTDIR_ATM=${RSTDIR:-$ROTDIR}/${CDUMP}.${PDY}/${cyc}/atmos/RERUN_RESTART
if [ ! -d $RSTDIR_ATM ]; then mkdir -p $RSTDIR_ATM ; fi
$NLN $RSTDIR_ATM RESTART
Expand Down Expand Up @@ -300,5 +300,5 @@ MOM6_predet(){
if [ ! -d $DATA/OUTPUT ]; then mkdir -p $DATA/OUTPUT; fi
if [ ! -d $DATA/MOM6_OUTPUT ]; then mkdir -p $DATA/MOM6_OUTPUT; fi
if [ ! -d $DATA/MOM6_RESTART ]; then mkdir -p $DATA/MOM6_RESTART; fi
cd $DATA || exit 8
cd "${DATA}" || exit 8
}
21 changes: 11 additions & 10 deletions workflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@ def _get_cycled_task_names(self):
wave_bndpnt_tasks = ['wavepostbndpnt', 'wavepostbndpntbll']
wave_post_tasks = ['wavepostsbs', 'wavepostpnt']

hybrid_gdas_or_gfs_tasks = []
hybrid_gdas_tasks = []
hybrid_tasks = []
hybrid_after_eupd_tasks = []
if self.do_hybvar:
if self.do_jediens:
hybrid_gdas_or_gfs_tasks += ['atmensanalprep', 'atmensanalrun', 'atmensanalpost', 'echgres']
hybrid_tasks += ['atmensanalprep', 'atmensanalrun', 'atmensanalpost', 'echgres']
else:
hybrid_gdas_or_gfs_tasks += ['eobs', 'eupd', 'echgres']
hybrid_gdas_or_gfs_tasks += ['ediag'] if self.lobsdiag_forenkf else ['eomg']
hybrid_gdas_tasks += ['ecen', 'esfc', 'efcs', 'epos', 'earc']
hybrid_tasks += ['eobs', 'eupd', 'echgres']
hybrid_tasks += ['ediag'] if self.lobsdiag_forenkf else ['eomg']
hybrid_after_eupd_tasks += ['ecen', 'esfc', 'efcs', 'epos', 'earc']

# Collect all "gdas" cycle tasks
gdas_tasks = gdas_gfs_common_tasks_before_fcst.copy()
Expand All @@ -386,8 +386,8 @@ def _get_cycled_task_names(self):

if self.do_hybvar:
if 'gdas' in self.eupd_cdumps:
gdas_tasks += hybrid_gdas_or_gfs_tasks
gdas_tasks += hybrid_gdas_tasks
gdas_tasks += hybrid_tasks
gdas_tasks += hybrid_after_eupd_tasks

if self.do_wave and 'gdas' in self.wave_cdumps:
if self.do_wave_bnd:
Expand All @@ -408,9 +408,10 @@ def _get_cycled_task_names(self):

if self.do_metp:
gfs_tasks += ['metp']

if self.do_hybvar and 'gfs' in self.eupd_cdumps:
gfs_tasks += hybrid_gdas_or_gfs_tasks
gfs_tasks += hybrid_tasks
gfs_tasks += hybrid_after_eupd_tasks
gfs_tasks.remove("echgres")

if self.do_wave and 'gfs' in self.wave_cdumps:
if self.do_wave_bnd:
Expand Down
24 changes: 6 additions & 18 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,6 @@ def atmensanalpost(self):

def ecen(self):

self._is_this_a_gdas_task(self.cdump, 'ecen')

def _get_ecengroups():

if self._base.get('DOIAU_ENKF', False):
Expand All @@ -1104,15 +1102,13 @@ def _get_ecengroups():

return grp, dep, lst

eupd_cdump = 'gdas' if 'gdas' in self.app_config.eupd_cdumps else 'gfs'

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}analcalc'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_jediens:
dep_dict = {'type': 'task', 'name': f'{eupd_cdump}atmensanalrun'}
dep_dict = {'type': 'task', 'name': f'{self.cdump}atmensanalrun'}
else:
dep_dict = {'type': 'task', 'name': f'{eupd_cdump}eupd'}
dep_dict = {'type': 'task', 'name': f'{self.cdump}eupd'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

Expand All @@ -1133,29 +1129,25 @@ def _get_ecengroups():

def esfc(self):

self._is_this_a_gdas_task(self.cdump, 'esfc')

eupd_cdump = 'gdas' if 'gdas' in self.app_config.eupd_cdumps else 'gfs'
#eupd_cdump = 'gdas' if 'gdas' in self.app_config.eupd_cdumps else 'gfs'

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}analcalc'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_jediens:
dep_dict = {'type': 'task', 'name': f'{eupd_cdump}atmensanalrun'}
dep_dict = {'type': 'task', 'name': f'{self.cdump}atmensanalrun'}
else:
dep_dict = {'type': 'task', 'name': f'{eupd_cdump}eupd'}
dep_dict = {'type': 'task', 'name': f'{self.cdump}eupd'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

resources = self.get_resource('esfc')
task = create_wf_task('esfc', resources, cdump='gdas', envar=self.envars, dependency=dependencies)
task = create_wf_task('esfc', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)

return task

def efcs(self):

self._is_this_a_gdas_task(self.cdump, 'efcs')

deps = []
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}ecmn'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down Expand Up @@ -1199,8 +1191,6 @@ def echgres(self):

def epos(self):

self._is_this_a_gdas_task(self.cdump, 'epos')

def _get_eposgroups(epos):
fhmin = epos['FHMIN_ENKF']
fhmax = epos['FHMAX_ENKF']
Expand Down Expand Up @@ -1245,8 +1235,6 @@ def _get_eposgroups(epos):

def earc(self):

self._is_this_a_gdas_task(self.cdump, 'earc')

deps = []
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}epmn'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down

0 comments on commit c5fc2b7

Please sign in to comment.