Skip to content

Commit

Permalink
Issue #527: update workflow generator, env, resources, jobs, and scri…
Browse files Browse the repository at this point in the history
…pts to execute global_cycle as a standalone job
  • Loading branch information
RussTreadon-NOAA committed Dec 14, 2021
1 parent 512ae81 commit 50b53b5
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 75 deletions.
10 changes: 9 additions & 1 deletion env/WCOSS_DELL_P3.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then

echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "anal fcst post vrfy metp"
echo "anal sfcanl fcst post vrfy metp"
echo "eobs eupd ecen esfc efcs epos"
echo "postsnd awips gempak"
exit 1
Expand Down Expand Up @@ -80,6 +80,14 @@ elif [ $step = "anal" ]; then
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="$launcher \$ncmd $mpmd"

elif [ $step = "sfcanl" ]; then
nth_max=$(($npe_node_max / $npe_node_sfcanl))

export NTHREADS_CYCLE=${nth_sfcanl:-14}
[[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max
npe_sfcanl=${ntiles:-6}
export APRUN_CYCLE="$launcher $npe_sfcanl"

elif [ $step = "gldas" ]; then

nth_max=$(($npe_node_max / $npe_node_gldas))
Expand Down
8 changes: 2 additions & 6 deletions jobs/JGLOBAL_ATMOS_SFCANL
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ date
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config}
configs="base anal analcalc"
configs="base sfcanl"
config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config}
for config in $configs; do
. $config_path/config.$config
Expand All @@ -22,7 +22,7 @@ done
##########################################
# Source machine runtime environment
##########################################
. $HOMEgfs/env/${machine}.env anal
. $HOMEgfs/env/${machine}.env sfcanl
status=$?
[[ $status -ne 0 ]] && exit $status

Expand Down Expand Up @@ -140,10 +140,6 @@ export TCVITL="${COMOUT}/${OPREFIX}syndata.tcvitals.tm00"
export DOGCYCLE=${DOGCYCLE:-"YES"}


# Generate Gaussian surface analysis
export DOGAUSFCANL=${DOGAUSFCANL:-"YES"}


###############################################################
# Run relevant script
env
Expand Down
13 changes: 13 additions & 0 deletions jobs/rocoto/sfcanl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/ksh -x

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
status=$?
[[ $status -ne 0 ]] && exit $status

###############################################################
# Execute the JJOB
$HOMEgfs/jobs/JGLOBAL_ATMOS_SFCANL
status=$?
exit $status
9 changes: 8 additions & 1 deletion parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 coupled_ic"
echo "anal analcalc analdiag gldas fcst post vrfy metp arch echgres"
echo "anal sfcanl analcalc analdiag gldas fcst post vrfy metp arch echgres"
echo "eobs ediag eomg eupd ecen esfc efcs epos earc"
echo "init_chem mom6ic ocnpost"
echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostbndpntbll wavepostpnt"
Expand Down Expand Up @@ -147,6 +147,13 @@ elif [ $step = "anal" ]; then
export nth_cycle=$nth_anal
if [[ "$machine" == "WCOSS_C" ]]; then export memory_anal="3072M"; fi

elif [ $step = "sfcanl" ]; then

export wtime_sfcanl="00:10:00"
export npe_sfcanl=6
export nth_sfcanl=$npe_node_max
export npe_node_sfcanl=$(echo "$npe_node_max / $nth_sfcanl" | bc)

elif [ $step = "analcalc" ]; then

export wtime_analcalc="00:10:00"
Expand Down
60 changes: 0 additions & 60 deletions scripts/exglobal_atmos_sfcanl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ export DELTSFC=${DELTSFC:-6}
export FIXgsm=${FIXgsm:-$HOMEgfs/fix/fix_am}
export FIXfv3=${FIXfv3:-$HOMEgfs/fix/fix_fv3_gmted2010}

DOGAUSFCANL=${DOGAUSFCANL-"NO"}
GAUSFCANLSH=${GAUSFCANLSH:-$HOMEgfs/ush/gaussian_sfcanl.sh}
export GAUSFCANLEXE=${GAUSFCANLEXE:-$HOMEgfs/exec/gaussian_sfcanl.exe}
NTHREADS_GAUSFCANL=${NTHREADS_GAUSFCANL:-1}
APRUN_GAUSFCANL=${APRUN_GAUSFCANL:-${APRUN:-""}}

# FV3 specific info (required for global_cycle)
export CASE=${CASE:-"C384"}
ntiles=${ntiles:-6}
Expand Down Expand Up @@ -292,60 +286,6 @@ if [ $DOGCYCLE = "YES" ]; then
fi


##############################################################
# If analysis increment is written by GSI, produce an analysis file here
if [ $DO_CALC_ANALYSIS == "YES" ]; then
# link analysis and increment files
$NLN $ATMANL siganl
$NLN $ATMINC siginc.nc
if [ $DOHYBVAR = "YES" -a $l4densvar = ".true." -a $lwrite4danl = ".true." ]; then
$NLN $ATMA03 siga03
$NLN $ATMI03 sigi03.nc
$NLN $ATMA04 siga04
$NLN $ATMI04 sigi04.nc
$NLN $ATMA05 siga05
$NLN $ATMI05 sigi05.nc
$NLN $ATMA07 siga07
$NLN $ATMI07 sigi07.nc
$NLN $ATMA08 siga08
$NLN $ATMI08 sigi08.nc
$NLN $ATMA09 siga09
$NLN $ATMI09 sigi09.nc
fi
# link guess files
$NLN $ATMG03 sigf03
$NLN $ATMGES sigf06
$NLN $ATMG09 sigf09

[[ -f $ATMG04 ]] && $NLN $ATMG04 sigf04
[[ -f $ATMG05 ]] && $NLN $ATMG05 sigf05
[[ -f $ATMG07 ]] && $NLN $ATMG07 sigf07
[[ -f $ATMG08 ]] && $NLN $ATMG08 sigf08

# Link hourly backgrounds (if present)
if [ -f $ATMG04 -a -f $ATMG05 -a -f $ATMG07 -a -f $ATMG08 ]; then
nhr_obsbin=1
fi

$CALCANLPY
export err=$?; err_chk
else
echo "Neither increment nor analysis are generated by external utils"
fi

##############################################################
# Create gaussian grid surface analysis file at middle of window
if [ $DOGAUSFCANL = "YES" ]; then
export APRUNSFC=$APRUN_GAUSFCANL
export OMP_NUM_THREADS_SFC=$NTHREADS_GAUSFCANL

$GAUSFCANLSH
export err=$?; err_chk
fi

echo "$CDUMP $CDATE atmanl and sfcanl done at `date`" > $COMOUT/${APREFIX}loganl.txt


################################################################################
# Postprocessing
cd $pwd
Expand Down
6 changes: 4 additions & 2 deletions sorc/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ fi
echo gsi checkout ...
if [[ ! -d gsi.fd ]] ; then
rm -f ${topdir}/checkout-gsi.log
git clone --recursive https://github.com/NOAA-EMC/GSI.git gsi.fd >> ${logdir}/checkout-gsi.log 2>&1
## git clone --recursive https://github.com/NOAA-EMC/GSI.git gsi.fd >> ${logdir}/checkout-gsi.log 2>&1
git clone --recursive https://github.com/RussTreadon-NOAA/GSI.git gsi.fd >> ${logdir}/checkout-gsi.log 2>&1
cd gsi.fd
git checkout 9c1fc15d42573b398037319bbf8d5143ad126fb6
## git checkout 9c1fc15d42573b398037319bbf8d5143ad126fb6
git checkout feature/rm_sfcanl
git submodule update
cd ${topdir}
else
Expand Down
30 changes: 25 additions & 5 deletions ush/rocoto/setup_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main():
print(f'input arg: --expdir = {repr(args.expdir)}')
sys.exit(1)

gfs_steps = ['prep', 'anal', 'analdiag', 'analcalc', 'gldas', 'fcst', 'postsnd', 'post', 'vrfy', 'arch']
gfs_steps = ['prep', 'anal', 'sfcanl', 'analdiag', 'analcalc', 'gldas', 'fcst', 'postsnd', 'post', 'vrfy', 'arch']
gfs_steps_gempak = ['gempak']
gfs_steps_awips = ['awips']
gfs_steps_wafs = ['wafs', 'wafsgrib2', 'wafsblending', 'wafsgcip', 'wafsgrib20p25', 'wafsblending0p25']
Expand Down Expand Up @@ -244,7 +244,7 @@ def get_gdasgfs_resources(dict_configs, cdump='gdas'):
reservation = base.get('RESERVATION', 'NONE').upper()

#tasks = ['prep', 'anal', 'fcst', 'post', 'vrfy', 'arch']
tasks = ['prep', 'anal', 'analcalc']
tasks = ['prep', 'anal', 'sfcanl', 'analcalc']

if cdump in ['gdas']:
tasks += ['analdiag']
Expand Down Expand Up @@ -485,13 +485,27 @@ def get_gdasgfs_tasks(dict_configs, cdump='gdas'):

dict_tasks[f'{cdump}anal'] = task

# sfcanl
deps = []
data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt'
dep_dict = {'type': 'data', 'data': data}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}anal'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)
task = wfu.create_wf_task('sfcanl', cdump=cdump, envar=envars, dependency=dependencies)

dict_tasks[f'{cdump}sfcanl'] = task

# analcalc
deps1 = []
deps = []
data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt'
dep_dict = {'type': 'data', 'data': data}
deps1.append(rocoto.add_dependency(dep_dict))
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}anal'}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'}
deps.append(rocoto.add_dependency(dep_dict))
if dohybvar in ['y', 'Y', 'yes', 'YES'] and cdump == 'gdas':
dep_dict = {'type': 'task', 'name': f'{"gdas"}echgres', 'offset': '-06:00:00'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down Expand Up @@ -530,6 +544,8 @@ def get_gdasgfs_tasks(dict_configs, cdump='gdas'):
deps1.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}anal'}
deps1.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}sfcanal'}
deps1.append(rocoto.add_dependency(dep_dict))
dependencies1 = rocoto.create_dependency(dep_condition='or', dep=deps1)

deps2 = []
Expand All @@ -553,11 +569,15 @@ def get_gdasgfs_tasks(dict_configs, cdump='gdas'):
dep_dict = {'type': 'task', 'name': f'{cdump}gldas'}
deps1.append(rocoto.add_dependency(dep_dict))
else:
dep_dict = {'type': 'task', 'name': f'{cdump}analcalc'}
dep_dict = {'type': 'task', 'name': f'{cdump}anal'}
deps1.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'}
deps1.append(rocoto.add_dependency(dep_dict))
elif cdump in ['gfs']:
dep_dict = {'type': 'task', 'name': f'{cdump}anal'}
deps1.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{cdump}sfcanal'}
deps1.append(rocoto.add_dependency(dep_dict))
dependencies1 = rocoto.create_dependency(dep_condition='or', dep=deps1)

if do_wave in ['Y', 'YES'] and cdump in cdumps:
Expand Down

0 comments on commit 50b53b5

Please sign in to comment.