Skip to content

Commit

Permalink
Move getic/init settings from scripts to configs
Browse files Browse the repository at this point in the history
- consolidate RETRO variable in config.getic
- move configuration settings from getic/init scripts to configs
- add dependency to setup_workflow_fcstonly.py
- add getic and init to task list at top of config.resources

Refs: NOAA-EMC#178
  • Loading branch information
KateFriedman-NOAA committed Mar 4, 2021
1 parent 1816067 commit d32199c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 54 deletions.
54 changes: 10 additions & 44 deletions jobs/rocoto/getic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ status=$?

###############################################################
# Source relevant configs
configs="base init"
configs="base getic init"
for config in $configs; do
. $EXPDIR/config.${config}
status=$?
Expand All @@ -36,53 +36,19 @@ status=$?
###############################################################
# Set script and dependency variables

yy=$(echo $CDATE | cut -c1-4)
mm=$(echo $CDATE | cut -c5-6)
dd=$(echo $CDATE | cut -c7-8)
hh=${cyc:-$(echo $CDATE | cut -c9-10)}
export yy=$(echo $CDATE | cut -c1-4)
export mm=$(echo $CDATE | cut -c5-6)
export dd=$(echo $CDATE | cut -c7-8)
export hh=${cyc:-$(echo $CDATE | cut -c9-10)}

export DATA=${DATA:-${DATAROOT}/init}

export EXTRACT_DIR=${EXTRACT_DIR:-$ROTDIR}
export WORKDIR=${WORKDIR:-$DATA}
export OUTDIR=${OUTDIR:-$ROTDIR}
PRODHPSSDIR=/NCEPPROD/hpssprod/runhistory/rh${yy}/${yy}${mm}/${yy}${mm}${dd}

COMPONENT="atmos"

gfs_ver=v16
GETICSH=${GDASINIT_DIR}/get_v16.data.sh

RETRO=${RETRO:-"NO"}
if [ $RETRO = "YES" ]; then
GETICSH=${GDASINIT_DIR}/get_v16retro.data.sh
fi

if [ $RETRO = "NO" ]; then # Operational input
# No ENKF data prior to 2012/05/21/00z
if [ $yy$mm$dd$hh -lt 2012052100 ]; then
set +x
echo FATAL ERROR: SCRIPTS DO NOT SUPPORT OLD GFS DATA
exit 2
elif [ $yy$mm$dd$hh -lt 2016051000 ]; then
gfs_ver=v12
GETICSH=${GDASINIT_DIR}/get_pre-v14.data.sh
elif [ $yy$mm$dd$hh -lt 2017072000 ]; then
gfs_ver=v13
GETICSH=${GDASINIT_DIR}/get_pre-v14.data.sh
elif [ $yy$mm$dd$hh -lt 2019061200 ]; then
gfs_ver=v14
GETICSH=${GDASINIT_DIR}/get_${gfs_ver}.data.sh
tarball=gpfs_hps_nco_ops_com_gfs_prod_gfs.${yy}${mm}${dd}_${hh}.pgrb2_${grid}.tar
elif [ $yy$mm$dd$hh -lt 2021031700 ]; then
gfs_ver=v15
GETICSH=${GDASINIT_DIR}/get_${gfs_ver}.data.sh
tarball=com_gfs_prod_gfs.${yy}${mm}${dd}_${hh}.gfs_pgrb2.tar
fi
fi

export EXTRACT_DIR yy mm dd hh UFS_DIR OUTDIR CRES_HIRES CRES_ENKF
export LEVS gfs_ver
export PRODHPSSDIR=${PRODHPSSDIR:-/NCEPPROD/hpssprod/runhistory}
export COMPONENT="atmos"
export gfs_ver=${gfs_ver:-v16}
export GETICSH=${GETICSH:-${GDASINIT_DIR}/get_v16.data.sh}

# Run get data script
if [ ! -d $EXTRACT_DIR ]; then mkdir -p $EXTRACT_DIR ; fi
Expand All @@ -96,7 +62,7 @@ if [ $gfs_ver = v14 -o $gfs_ver = v15 ]; then
for grid in 0p25 0p50 1p00
do
file=gfs.t${hh}z.pgrb2.${grid}.anl
htar -xvf ${PRODHPSSDIR}/${tarball} ./${CDUMP}.${yy}${mm}${dd}/${hh}/${file}
htar -xvf ${PRODHPSSDIR}/rh${yy}/${yy}${mm}/${yy}${mm}${dd}/${tarball} ./${CDUMP}.${yy}${mm}${dd}/${hh}/${file}
mv ${EXTRACT_DIR}/${CDUMP}.${yy}${mm}${dd}/${hh}/${file} ${OUTDIR}/${CDUMP}.${yy}${mm}${dd}/${hh}/${COMPONENT}/${file}
done
fi
Expand Down
2 changes: 1 addition & 1 deletion jobs/rocoto/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ status=$?

###############################################################
# Source relevant configs
configs="base init"
configs="base getic init"
for config in $configs; do
. $EXPDIR/config.${config}
status=$?
Expand Down
36 changes: 32 additions & 4 deletions parm/config/config.getic
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,39 @@ echo "BEGIN: config.getic"
# Get task specific resources
. $EXPDIR/config.resources getic

UFS_DIR=${HOMEgfs}/sorc/ufs_utils.fd
GDASINIT_DIR=${UFS_DIR}/util/gdas_init
export RETRO="NO" # YES = Pull v16 inputs from retrospective parallels; NO = use operational inputs
export gfs_ver="v16" # Default = v16

EXTRACT_DATA="yes"
export UFS_DIR=${HOMEgfs}/sorc/ufs_utils.fd
export GDASINIT_DIR=${UFS_DIR}/util/gdas_init

RETRO="NO" # YES = Pull v16 inputs from retrospective parallels; NO = use operational inputs
export PRODHPSSDIR=/NCEPPROD/hpssprod/runhistory
export GETICSH=${GDASINIT_DIR}/get_v16.data.sh

if [ ${RETRO:-"NO"} = "YES" ]; then
export GETICSH=${GDASINIT_DIR}/get_v16retro.data.sh
fi

if [ ${RETRO:-"NO"} = "NO" ]; then # Operational input
# No ENKF data prior to 2012/05/21/00z
if [[ "$CDATE" -lt "2012052100" ]]; then
set +x
echo FATAL ERROR: SCRIPTS DO NOT SUPPORT OLD GFS DATA
elif [[ "$CDATE" -lt "2016051000" ]]; then
export gfs_ver=v12
export GETICSH=${GDASINIT_DIR}/get_pre-v14.data.sh
elif [[ "$CDATE" -lt "2017072000" ]]; then
export gfs_ver=v13
export GETICSH=${GDASINIT_DIR}/get_pre-v14.data.sh
elif [[ "$CDATE" -lt "2019061200" ]]; then
export gfs_ver=v14
export GETICSH=${GDASINIT_DIR}/get_${gfs_ver}.data.sh
export tarball=gpfs_hps_nco_ops_com_gfs_prod_gfs.${PDY}_${cyc}.pgrb2_${grid}.tar
elif [[ "$CDATE" -lt "2021031700" ]]; then
export gfs_ver=v15
export GETICSH=${GDASINIT_DIR}/get_${gfs_ver}.data.sh
export tarball=com_gfs_prod_gfs.${PDY}_${cyc}.gfs_pgrb2.tar
fi
fi

echo "END: config.getic"
35 changes: 30 additions & 5 deletions parm/config/config.init
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,37 @@ echo "BEGIN: config.init"
# Get task specific resources
. $EXPDIR/config.resources init

UFS_DIR=${HOMEgfs}/sorc/ufs_utils.fd
GDASINIT_DIR=${UFS_DIR}/util/gdas_init
# Get task specific resources
. $EXPDIR/config.getic

export UFS_DIR=${HOMEgfs}/sorc/ufs_utils.fd
export GDASINIT_DIR=${UFS_DIR}/util/gdas_init

export CRES_HIRES=$CASE
export CRES_ENKF=$CASE_ENKF

RETRO="NO" # YES = Pull v16 inputs from retrospective parallels; NO = use operational inputs
if [ ${RETRO:-"NO"} = "YES" ]; then
export GETICSH=${GDASINIT_DIR}/run_v16retro.chgres.sh
fi

CRES_HIRES=$CASE
CRES_ENKF=$CASE_ENKF
if [ ${RETRO:-"NO"} = "NO" ]; then # Operational input
# No ENKF data prior to 2012/05/21/00z
if [[ "$CDATE" -lt "2012052100" ]]; then
set +x
echo FATAL ERROR: SCRIPTS DO NOT SUPPORT OLD GFS DATA
elif [[ "$CDATE" -lt "2016051000" ]]; then
export gfs_ver=v12
export RUNICSH=${GDASINIT_DIR}/run_pre-v14.chgres.sh
elif [[ "$CDATE" -lt "2017072000" ]]; then
export gfs_ver=v13
export RUNICSH=${GDASINIT_DIR}/run_pre-v14.chgres.sh
elif [[ "$CDATE" -lt "2019061200" ]]; then
export gfs_ver=v14
export RUNICSH=${GDASINIT_DIR}/run_${gfs_ver}.chgres.sh
elif [[ "$CDATE" -lt "2021031700" ]]; then
export gfs_ver=v15
export RUNICSH=${GDASINIT_DIR}/run_${gfs_ver}.chgres.gfs.sh
fi
fi

echo "END: config.init"
1 change: 1 addition & 0 deletions parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if [ $# -ne 1 ]; then

echo "Must specify an input task argument to set resource variables!"
echo "argument can be any one of the following:"
echo "getic init"
echo "anal analcalc analdiag gldas fcst post vrfy metp arch echgres"
echo "eobs ediag eomg eupd ecen esfc efcs epos earc"
echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostpnt"
Expand Down
3 changes: 3 additions & 0 deletions ush/rocoto/setup_workflow_fcstonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ def get_workflow(dict_configs, cdump='gdas'):
data = '&ROTDIR;/&CDUMP;.@Y@m@d/@H/[email protected]'
dep_dict = {'type':'data', 'data':data}
deps.append(rocoto.add_dependency(dep_dict))
data = '&ROTDIR;/&CDUMP;.@Y@m@d/@H/atmos/[email protected]'
dep_dict = {'type':'data', 'data':data}
deps.append(rocoto.add_dependency(dep_dict))
data = '&ROTDIR;/&CDUMP;.@Y@m@d/@H/atmos/RESTART/@Y@m@[email protected]_data.tile6.nc'
dep_dict = {'type':'data', 'data':data}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down

0 comments on commit d32199c

Please sign in to comment.