Skip to content

Commit

Permalink
Fix inline post issue in nco mode (#541)
Browse files Browse the repository at this point in the history
* Remove echo from script

* Add path to result files

* Add a new WE2E test for inline post in nco mode
  • Loading branch information
chan-hoo authored Jul 9, 2021
1 parent c0e858b commit 91d5fbf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
16 changes: 8 additions & 8 deletions scripts/exregional_run_fcst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,13 @@ code."
# Only for inline post, create the directory where post-processing output
# are stored (postprd_dir)
if [ ${WRITE_DOPOST} = "TRUE" ]; then

yyyymmdd=${cdate:0:8}
hh=${cdate:8:2}
cyc=$hh
tmmark="tm00"
fmn="00"

if [ "${RUN_ENVIR}" = "nco" ]; then
COMOUT="${COMOUT_BASEDIR}/$RUN.$PDY/$cyc${SLASH_ENSMEM_SUBDIR}"
postprd_dir="$COMOUT"
Expand All @@ -551,14 +558,7 @@ if [ ${WRITE_DOPOST} = "TRUE" ]; then

cd_vrfy ${postprd_dir}

yyyymmdd=${cdate:0:8}
hh=${cdate:8:2}
cyc=$hh
tmmark="tm00"
fmn="00"

for fhr in $(seq -f "%02g" 0 ${FCST_LEN_HRS}); do
echo $fhr
post_time=$( date --utc --date "${yyyymmdd} ${hh} UTC + ${fhr} hours + ${fmn} minutes" "+%Y%m%d%H%M" )
post_mn=${post_time:10:2}
post_mn_or_null=""
Expand All @@ -572,7 +572,7 @@ if [ ${WRITE_DOPOST} = "TRUE" ]; then
FID="${fid^^}"
post_orig_fn="${FID}.${post_fn_suffix}"
post_renamed_fn="${NET}.t${cyc}z.${fid}${post_renamed_fn_suffix}"
mv_vrfy ../${post_orig_fn} ${post_renamed_fn}
mv_vrfy ${run_dir}/${post_orig_fn} ${post_renamed_fn}
ln_vrfy -fs ${post_renamed_fn} ${FID}${symlink_suffix}
done
done
Expand Down
28 changes: 28 additions & 0 deletions tests/baseline_configs/config.nco_inline_post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# TEST PURPOSE/DESCRIPTION:
# ------------------------
#
# This test checks the capability of the workflow to use the inline
# post option (WRITE_DOPOST) in model_configure for 'nco' mode.
#

RUN_ENVIR="nco"
PREEXISTING_DIR_METHOD="rename"

PREDEF_GRID_NAME="RRFS_CONUS_25km"
WRITE_DOPOST="TRUE"

CCPP_PHYS_SUITE="FV3_GFS_v15p2"

EXTRN_MDL_NAME_ICS="FV3GFS"
EXTRN_MDL_NAME_LBCS="FV3GFS"
USE_USER_STAGED_EXTRN_FILES="TRUE"

DATE_FIRST_CYCL="20190701"
DATE_LAST_CYCL="20190701"
CYCL_HRS=( "00" )

FCST_LEN_HRS="6"
LBC_SPEC_INTVL_HRS="3"


1 change: 1 addition & 0 deletions tests/baselines_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ nco_grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2
nco_grid_RRFS_CONUS_3km_ics_HRRR_lbcs_RAP_suite_GSD_SAR
nco_grid_RRFS_CONUS_3km_ics_HRRR_lbcs_RAP_suite_HRRR
nco_grid_RRFS_SUBCONUS_3km_ics_HRRR_lbcs_RAP_suite_GSD_SAR
nco_inline_post
new_ESGgrid
new_GFDLgrid
new_GFDLgrid__GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES_eq_FALSE
Expand Down
7 changes: 6 additions & 1 deletion ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,12 @@ if [ "$WRITE_DOPOST" = "TRUE" ] || \
# Turn off run_post
RUN_TASK_RUN_POST="FALSE"

# Check if SUB_HOURLY_POST is on
if [ "${SUB_HOURLY_POST}" = "TRUE" ]; then
print_err_msg_exit "\
SUB_HOURLY_POST is NOT available with Inline Post yet."
fi

elif [ "$WRITE_DOPOST" = "FALSE" ] || \
[ "$WRITE_DOPOST" = "NO" ]; then
WRITE_DOPOST="FALSE"
Expand Down Expand Up @@ -2247,7 +2253,6 @@ fi
#
NNODES_RUN_FCST=$(( (PE_MEMBER01 + PPN_RUN_FCST - 1)/PPN_RUN_FCST ))


#
#-----------------------------------------------------------------------
#
Expand Down

0 comments on commit 91d5fbf

Please sign in to comment.