Skip to content

Commit

Permalink
Source the machine file before config.sh
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christinaholtNOAA committed Apr 19, 2022
1 parent 76a0f9b commit f91d0bf
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -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


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

0 comments on commit f91d0bf

Please sign in to comment.