Skip to content

Commit

Permalink
Add custom post config file capability (#299)
Browse files Browse the repository at this point in the history
* Add custom post config file capability

* Switch custom UPP config file check to setup.sh

* Additional mods needed for custom UPP functionality

* Add print statementsfor flat file location

* Add print statementsfor flat file location

* Revert "Add print statementsfor flat file location"

This reverts commit c1cb2a61f1a00f440f11bc042c3accdcbe8950c5.

Co-authored-by: Tracy <tracy.hertneky@noaa.gov>
  • Loading branch information
hertneky and Tracy authored Sep 23, 2020
1 parent 5518a0d commit 48ef993
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
16 changes: 15 additions & 1 deletion scripts/exregional_run_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,21 @@ esac
#
rm_vrfy -f fort.*
cp_vrfy ${EMC_POST_DIR}/parm/nam_micro_lookup.dat ./eta_micro_lookup.dat
cp_vrfy ${EMC_POST_DIR}/parm/postxconfig-NT-fv3sar.txt ./postxconfig-NT.txt
if [ ${USE_CUSTOM_POST_CONFIG_FILE} = "TRUE" ]; then
cp_vrfy ${CUSTOM_POST_CONFIG_PATH} ./postxconfig-NT.txt
print_info_msg "
====================================================================
Using user-defined UPP flat file:
${CUSTOM_POST_CONFIG_PATH}
===================================================================="
else
cp_vrfy ${EMC_POST_DIR}/parm/postxconfig-NT-fv3sar.txt ./postxconfig-NT.txt
print_info_msg "
====================================================================
Using default UPP flat file:
${EMC_POST_DIR}/parm/postxconfig-NT-fv3sar.txt
===================================================================="
fi
cp_vrfy ${EMC_POST_DIR}/parm/params_grib2_tbl_new ./params_grib2_tbl_new
cp_vrfy ${EXECDIR}/ncep_post .
#
Expand Down
22 changes: 22 additions & 0 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,28 @@ WTIME_RUN_POST="00:15:00"
#
#-----------------------------------------------------------------------
#
# Set parameters associated with defining a customized post configuration file
#
# USE_CUSTOM_POST_CONFIG_FILE:
# Flag that determines whether a user provided custom configuration file
# should be used for post-processing the model data. If this is set to
# "TRUE", then the workflow will link the custom configuration file from
# the user-defined path specified in CUSTOM_POST_CONFIG_PATH. Otherwise,
# if set to "FALSE" (default), this parameter is not used and the default
# configuration file will be used for post-processing.
#
# CUSTOM_POST_CONFIG_PATH:
# The full path pointing to the cusomized post flat file, including filename,
# to be used for post-processing. This is only used if CUSTOM_POST_CONFIG_FILE
# is set to "TRUE".
#
#-----------------------------------------------------------------------
#
USE_CUSTOM_POST_CONFIG_FILE="FALSE"
CUSTOM_POST_CONFIG_PATH=""
#
#-----------------------------------------------------------------------
#
# Set parameters associated with running ensembles. Definitions:
#
# DO_ENSEMBLE:
Expand Down
36 changes: 36 additions & 0 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,42 @@ fi
#
#-----------------------------------------------------------------------
#
# Make sure that USE_CUSTOM_POST_CONFIG_FILE is set to a valid value.
#
#-----------------------------------------------------------------------
#
check_var_valid_value \
"USE_CUSTOM_POST_CONFIG_FILE" "valid_vals_USE_CUSTOM_POST_CONFIG_FILE"
#
# Set USE_CUSTOM_POST_CONFIG_FILE to either "TRUE" or "FALSE" so we don't
# have to consider other valid values later on.
#
USE_CUSTOM_POST_CONFIG_FILE=${USE_CUSTOM_POST_CONFIG_FILE^^}
if [ "$USE_CUSTOM_POST_CONFIG_FILE" = "TRUE" ] || \
[ "$USE_CUSTOM_POST_CONFIG_FILE" = "YES" ]; then
USE_CUSTOM_POST_CONFIG_FILE="TRUE"
elif [ "$USE_CUSTOM_POST_CONFIG_FILE" = "FALSE" ] || \
[ "$USE_CUSTOM_POST_CONFIG_FILE" = "NO" ]; then
USE_CUSTOM_POST_CONFIG_FILE="FALSE"
fi
#
#-----------------------------------------------------------------------
#
# Check that the path exists for a user-defined custom post config file
#
if [ ${USE_CUSTOM_POST_CONFIG_FILE} = "TRUE" ]; then
if [ -f "${CUSTOM_POST_CONFIG_PATH}" ]; then
print_info_msg "
Using custom post config file in path: \"${CUSTOM_POST_CONFIG_PATH}\""
else
print_err_msg_exit "
Cannot use custom post config file because file does not exist:
\"${CUSTOM_POST_CONFIG_PATH}\""
fi
fi
#
#-----------------------------------------------------------------------
#
# The forecast length (in integer hours) cannot contain more than 3 cha-
# racters. Thus, its maximum value is 999. Check whether the specified
# forecast length exceeds this maximum value. If so, print out a warn-
Expand Down
1 change: 1 addition & 0 deletions ush/valid_param_vals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ valid_vals_DOT_OR_USCORE=("." "_")
valid_vals_NOMADS=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_NOMADS_file_type=("GRIB2" "grib2" "NEMSIO" "nemsio")
valid_vals_DO_ENSEMBLE=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_USE_CUSTOM_POST_CONFIG_FILE=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_DO_SHUM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_DO_SPPT=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_DO_SKEB=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
Expand Down

0 comments on commit 48ef993

Please sign in to comment.