From f91d0bf1d4d3e9d6d8864988907f8dd92bcc1e1c Mon Sep 17 00:00:00 2001 From: "Christina.Holt" Date: Tue, 19 Apr 2022 22:46:13 +0000 Subject: [PATCH] Source the machine file before config.sh With the addition of a configurable data stores variable that is machine-dependent, we must load the machine file configs first so that we can override the values for the specific configuration. --- ush/setup.sh | 82 ++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/ush/setup.sh b/ush/setup.sh index 96335350e..69927d4ef 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -91,6 +91,47 @@ Starting function ${func_name}() in \"${scrfunc_fn}\"... # EXPT_DEFAULT_CONFIG_FN="config_defaults.sh" . ./${EXPT_DEFAULT_CONFIG_FN} +# +#----------------------------------------------------------------------- +# +# Convert machine name to upper case if necessary. Then make sure that +# MACHINE is set to a valid value. +# +#----------------------------------------------------------------------- +# +MACHINE=$( printf "%s" "$MACHINE" | $SED -e 's/\(.*\)/\U\1/' ) +check_var_valid_value "MACHINE" "valid_vals_MACHINE" +# +#----------------------------------------------------------------------- +# +# Source the machine config file containing architechture information, +# queue names, and supported input file paths. +# +#----------------------------------------------------------------------- +# +RELATIVE_LINK_FLAG="--relative" +MACHINE_FILE=${MACHINE_FILE:-${USHDIR}/machine/$(echo_lowercase $MACHINE).sh} +source $USHDIR/source_machine_file.sh + +if [ -z "${NCORES_PER_NODE:-}" ]; then + print_err_msg_exit "\ + NCORES_PER_NODE has not been specified in the file ${MACHINE_FILE} + Please ensure this value has been set for your desired platform. " +fi + +if [ -z "$FIXgsm" -o -z "$FIXaer" -o -z "$FIXlut" -o -z "$TOPO_DIR" -o -z "$SFC_CLIMO_INPUT_DIR" ]; then + print_err_msg_exit "\ +One or more fix file directories have not been specified for this machine: + MACHINE = \"$MACHINE\" + FIXgsm = \"${FIXgsm:-\"\"} + FIXaer = \"${FIXaer:-\"\"} + FIXlut = \"${FIXlut:-\"\"} + TOPO_DIR = \"${TOPO_DIR:-\"\"} + SFC_CLIMO_INPUT_DIR = \"${SFC_CLIMO_INPUT_DIR:-\"\"} + DOMAIN_PREGEN_BASEDIR = \"${DOMAIN_PREGEN_BASEDIR:-\"\"} +You can specify the missing location(s) in ${machine_file}" +fi + # #----------------------------------------------------------------------- # @@ -478,47 +519,6 @@ VX_CONFIG_DIR="$TEMPLATE_DIR/parm" METPLUS_CONF="$TEMPLATE_DIR/parm/metplus" MET_CONFIG="$TEMPLATE_DIR/parm/met" -# -#----------------------------------------------------------------------- -# -# Convert machine name to upper case if necessary. Then make sure that -# MACHINE is set to a valid value. -# -#----------------------------------------------------------------------- -# -MACHINE=$( printf "%s" "$MACHINE" | $SED -e 's/\(.*\)/\U\1/' ) -check_var_valid_value "MACHINE" "valid_vals_MACHINE" -# -#----------------------------------------------------------------------- -# -# Source the machine config file containing architechture information, -# queue names, and supported input file paths. -# -#----------------------------------------------------------------------- -# -RELATIVE_LINK_FLAG="--relative" -MACHINE_FILE=${MACHINE_FILE:-${USHDIR}/machine/$(echo_lowercase $MACHINE).sh} -source $USHDIR/source_machine_file.sh - -if [ -z "${NCORES_PER_NODE:-}" ]; then - print_err_msg_exit "\ - NCORES_PER_NODE has not been specified in the file ${MACHINE_FILE} - Please ensure this value has been set for your desired platform. " -fi - -if [ -z "$FIXgsm" -o -z "$FIXaer" -o -z "$FIXlut" -o -z "$TOPO_DIR" -o -z "$SFC_CLIMO_INPUT_DIR" ]; then - print_err_msg_exit "\ -One or more fix file directories have not been specified for this machine: - MACHINE = \"$MACHINE\" - FIXgsm = \"${FIXgsm:-\"\"} - FIXaer = \"${FIXaer:-\"\"} - FIXlut = \"${FIXlut:-\"\"} - TOPO_DIR = \"${TOPO_DIR:-\"\"} - SFC_CLIMO_INPUT_DIR = \"${SFC_CLIMO_INPUT_DIR:-\"\"} - DOMAIN_PREGEN_BASEDIR = \"${DOMAIN_PREGEN_BASEDIR:-\"\"} -You can specify the missing location(s) in ${machine_file}" -fi - # #-----------------------------------------------------------------------