Skip to content

Commit

Permalink
Issue #8: rename JGLOBAL_CHGRESFCST and exglobal_chgresfcst_fv3gfs.sh…
Browse files Browse the repository at this point in the history
….ecf
  • Loading branch information
RussTreadon-NOAA committed Jun 16, 2020
1 parent e15074e commit ef6f474
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
4 changes: 2 additions & 2 deletions jobs/JGLOBAL_CHGRESFCST → jobs/JGDAS_ENKF_CHGRES
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 chgresfcst"
configs="base anal echgres"
config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config}
for config in $configs; do
. $config_path/config.$config
Expand Down Expand Up @@ -106,7 +106,7 @@ postmsg "$jlogfile" "$msg"
$LOGSCRIPT


${CHGRESFCSTSH:-$HOMEgsi/scripts/exglobal_chgresfcst_fv3gfs.sh.ecf}
${CHGRESFCSTSH:-$HOMEgsi/scripts/exglobal_enkf_chgres_fv3gfs.sh.ecf}
status=$?
[[ $status -ne 0 ]] && exit $status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
#### UNIX Script Documentation Block
# . .
# Script name: exglobal_chgres_fcst.sh.ecf
# Script name: exglobal_enkf_chgresfcst.sh.ecf
# Script description: Runs chgres on full-resolution forecast for EnKF recentering
#
# Author: Cory Martin Org: NCEP/EMC Date: 2020-06-08
Expand Down Expand Up @@ -68,6 +68,7 @@ export IAUFHRS=${IAUFHRS:-"6"}
export APRUN_CHGRES=${APRUN_CHGRES:-${APRUN:-""}}
export CHGRESNCEXEC=${CHGRESNCEXEC:-$HOMEgfs/exec/chgres_recenter_ncio.exe}
export NTHREADS_CHGRES=${NTHREADS_CHGRES:-1}
APRUNCFP=${APRUNCFP:-""}

# OPS flags
RUN=${RUN:-""}
Expand Down Expand Up @@ -101,6 +102,12 @@ ATMFCST_ENSRES=${ATMFCST_ENSRES:-${COMOUT_ENS}/mem001/${APREFIX}atmf006${ASUFFIX
# Set script / GSI control parameters
DOHYBVAR=${DOHYBVAR:-"NO"}
lrun_subdirs=${lrun_subdirs:-".true."}
USE_CFP=${USE_CFP:-"NO"}
CFP_MP=${CFP_MP:-"NO"}
nm=""
if [ $CFP_MP = "YES" ]; then
nm=0
fi
if [ $DOHYBVAR = "YES" ]; then
l_hyb_ens=.true.
export l4densvar=${l4densvar:-".false."}
Expand Down Expand Up @@ -149,11 +156,16 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then
fi
export OMP_NUM_THREADS=$NTHREADS_CHGRES
SIGLEVEL=${SIGLEVEL:-${FIXgsm}/global_hyblev.l${LEVS_ENKF}.txt}

if [ $USE_CFP = "YES" ]; then
rm $DATA/mp_chgres.sh
fi

nfhrs=`echo $IAUFHRS_ENKF | sed 's/,/ /g'`
for FHR in $nfhrs; do
echo "Regridding deterministic forecast for forecast hour $FHR"
rm -f chgres_nc_gauss.nml
cat > chgres_nc_gauss.nml << EOF
rm -f chgres_nc_gauss0$FHR.nml
cat > chgres_nc_gauss0$FHR.nml << EOF
&chgres_setup
i_output=$LONB_ENKF
j_output=$LATB_ENKF
Expand All @@ -163,15 +175,46 @@ terrain_file="atmens_fcst"
vcoord_file="$SIGLEVEL"
/
EOF
$APRUN_CHGRES $CHGRESNCEXEC
rc=$?
export ERR=$rc
export err=$ERR
$ERRSCRIPT || exit 3
if [ $USE_CFP = "YES" ]; then
echo "$APRUN_CHGRES $CHGRESNCEXEC chgres_nc_gauss0$FHR.nml" | tee -a $DATA/mp_chgres.sh
else
$APRUN_CHGRES $CHGRESNCEXEC chgres_nc_gauss0$FHR.nml
rc=$?
export ERR=$rc
export err=$ERR
$ERRSCRIPT || exit 3
fi
done

if [ $USE_CFP = "YES" ]; then
chmod 755 $DATA/mp_chgres.sh
ncmd=$(cat $DATA/mp_chgres.sh | wc -l)
if [ $ncmd -gt 0 ]; then
ncmd_max=$((ncmd < npe_node_max ? ncmd : npe_node_max))
APRUNCFP_CHGRES=$(eval echo $APRUNCFP)
if [ ${CFP_MP:-"NO"} = "YES" ]; then
if [ -s $DATA/mp_chgres_srun.sh ]; then rm -f $DATA/mp_chgres_srun.sh; fi
touch $DATA/mp_chgres_srun.sh
nm=0
cat $DATA/mp_chgres.sh | while read line; do
echo "$nm $line" >> $DATA/mp_chgres_srun.sh
nm=$((nm+1))
done
$APRUNCFP_CHGRES -n $nm --multi-prog $DATA/mp_chgres_srun.sh
else
$APRUNCFP_CHGRES $DATA/mp_chgres.sh
export ERR=$?
export err=$ERR
$ERRSCRIPT || exit 3
fi
fi
fi

else
echo "DO_CALC_ANALYSIS != YES, doing nothing"
fi


################################################################################
# Postprocessing
cd $pwd
Expand Down

0 comments on commit ef6f474

Please sign in to comment.