Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions etc/lmod-setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ EOF_USAGE
else
set L_MACHINE=$1
endif

source /etc/csh.login

if ( "$L_MACHINE" == macos ) then
set ENV="/opt/homebrew/opt/lmod/init/csh"
Expand Down
8 changes: 8 additions & 0 deletions etc/lmod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ else
L_MACHINE=$1
fi

[[ ${SHELLOPTS} =~ nounset ]] && has_mu=true || has_mu=false
[[ ${SHELLOPTS} =~ errexit ]] && has_me=true || has_me=false
$has_mu && set +u
$has_me && set +e
source /etc/profile
$has_mu && set -u
$has_me && set -e

if [ "$L_MACHINE" = macos ]; then
export BASH_ENV="/opt/homebrew/opt/lmod/init/bash"
# export BASH_ENV="/usr/local/opt/lmod/init/bash"
Expand Down
19 changes: 1 addition & 18 deletions tests/WE2E/setup_WE2E_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,7 @@ exec_subdir="install_${compiler}/exec"
#-----------------------------------------------------------------------

# Load Python Modules
env_path="${SRW_APP_DIR}/modulefiles"
env_file="wflow_${machine}"
echo "-- Load environment =>" $env_file
source ${SRW_APP_DIR}/etc/lmod-setup.sh ${machine}
module use ${env_path}
module load ${env_file}

if [[ "${machine}" == 'cheyenne' ]]; then
conda activate /glade/p/ral/jntp/UFS_SRW_app/conda/regional_workflow
else
if [[ "${machine}" == 'noaacloud' && -z "${PROJ_LIB-}" ]]; then
PROJ_LIB=''
fi

conda activate regional_workflow
fi

module list
source ${SRW_APP_DIR}/ush/load_modules_wflow.sh ${machine}

# Run the E2E Workflow tests
./run_WE2E_tests.sh \
Expand Down
15 changes: 3 additions & 12 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ platform:
DOMAIN_PREGEN_BASEDIR: ""
#
#-----------------------------------------------------------------------
# Scripts and commands needed by workflow and tasks
# Pre task commands such as "ulimit" needed by tasks
#-----------------------------------------------------------------------
#
ENV_INIT_SCRIPTS_FPS: []
PRE_TASK_CMDS: ""
#
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -1103,6 +1102,7 @@ task_make_orog:
OMP_NUM_THREADS_MAKE_OROG: 6
OMP_STACKSIZE_MAKE_OROG: "2048m"
OROG_DIR: ""
TOPO_DIR: ""

#----------------------------
# MAKE SFC CLIMO config parameters
Expand All @@ -1117,6 +1117,7 @@ task_make_sfc_climo:
OMP_NUM_THREADS_MAKE_SFC_CLIMO: 1
OMP_STACKSIZE_MAKE_SFC_CLIMO: "1024m"
SFC_CLIMO_DIR: ""
SFC_CLIMO_INPUT_DIR: ""

#----------------------------
# EXTRN ICS config parameters
Expand Down Expand Up @@ -1628,14 +1629,6 @@ task_run_fcst:
# FIXlut:
# System directory where the lookup tables for optics properties are located
#
# TOPO_DIR:
# The location on disk of the static input files used by the make_orog
# task (orog.x and shave.x). Can be the same as FIXgsm.
#
# SFC_CLIMO_INPUT_DIR:
# The location on disk of the static surface climatology input fields, used by
# sfc_climo_gen. These files are only used if RUN_TASK_MAKE_SFC_CLIMO=TRUE
#
# FNGLAC, ..., FNMSKH:
# Names of (some of the) global data files that are assumed to exist in
# a system directory specified (this directory is machine-dependent;
Expand Down Expand Up @@ -1691,8 +1684,6 @@ task_run_fcst:
FIXgsm: ""
FIXaer: ""
FIXlut: ""
TOPO_DIR: ""
SFC_CLIMO_INPUT_DIR: ""

FNGLAC: &FNGLAC "global_glacier.2x2.grb"
FNMXIC: &FNMXIC "global_maxice.2x2.grb"
Expand Down
51 changes: 0 additions & 51 deletions ush/init_env.sh

This file was deleted.

37 changes: 2 additions & 35 deletions ush/launch_FV3LAM_wflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ fi
#
. $exptdir/var_defns.sh
. $USHdir/source_util_funcs.sh
. $USHdir/init_env.sh
#
#-----------------------------------------------------------------------
#
Expand All @@ -122,16 +121,6 @@ called_from_cron=$(boolify "${called_from_cron}")
#
#-----------------------------------------------------------------------
#
# Initialize the environment, e.g. by making the "module" command as well
# as others available.
#
#-----------------------------------------------------------------------
#
env_init_scripts_fps_str="( "$(printf "\"%s\" " "${ENV_INIT_SCRIPTS_FPS[@]}")")"
init_env env_init_scripts_fps="${env_init_scripts_fps_str}"
#
#-----------------------------------------------------------------------
#
# Set the name of the experiment. We take this to be the name of the
# experiment subdirectory (i.e. the string after the last "/" in the
# full path to the experiment directory).
Expand All @@ -146,31 +135,9 @@ expt_name="${EXPT_SUBDIR}"
#
#-----------------------------------------------------------------------
#
# source version file (run) only if it is specified in versions directory
VERSION_FILE="${HOMEdir}/versions/${RUN_VER_FN}"
if [ -f ${VERSION_FILE} ]; then
. ${VERSION_FILE}
fi
module use "${HOMEdir}/modulefiles"
module load "${WFLOW_MOD_FN}" > /dev/null 2>&1 || print_err_msg_exit "\
Loading of platform-specific module file (WFLOW_MOD_FN) for the workflow
task failed:
WFLOW_MOD_FN = \"${WFLOW_MOD_FN}\""
machine=$(echo_lowercase $MACHINE)

#
#-----------------------------------------------------------------------
#
# Hack for Cheyenne since system python3 version is 3.4.10.
# SRW app requires at least 3.6 so crontab deletion doesn't work with it.
# Here we switch to using the python3 in conda that satisfies the requirement.
# In the future, we could do conda activate on all systems here, to get rid
# of the system python requirement.
#
#-----------------------------------------------------------------------
#
if [ "$MACHINE" = "CHEYENNE" ]; then
conda activate /glade/p/ral/jntp/UFS_SRW_app/conda/regional_workflow
fi
. ${USHdir}/load_modules_wflow.sh ${machine}

#
#-----------------------------------------------------------------------
Expand Down
15 changes: 4 additions & 11 deletions ush/load_modules_run_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#
. ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/source_util_funcs.sh
. $USHdir/init_env.sh
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -66,16 +65,6 @@ fi
#
#-----------------------------------------------------------------------
#
# Initialize the environment, e.g. by making available the "module"
# command as well as others.
#
#-----------------------------------------------------------------------
#
env_init_scripts_fps_str="( "$(printf "\"%s\" " "${ENV_INIT_SCRIPTS_FPS[@]}")")"
init_env env_init_scripts_fps="${env_init_scripts_fps_str}"
#
#-----------------------------------------------------------------------
#
# Get the task name and the name of the J-job script.
#
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -195,6 +184,10 @@ module list
if [ -n "${SRW_ENV:-}" ] ; then
set +u
conda activate ${SRW_ENV}
if [ $machine = "gaea" ]; then
conda deactivate
conda activate ${SRW_ENV}
fi
set -u
fi

Expand Down
74 changes: 74 additions & 0 deletions ush/load_modules_wflow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

#
#-----------------------------------------------------------------------
#
# This script loads the workflow modulefile for a given machine.
# It is a central place for all other scripts so that this is the only
# place workflow module loading can be modified.
#
#-----------------------------------------------------------------------
#

function usage() {
cat << EOF_USAGE
Usage: source $0 PLATFORM

OPTIONS:
PLATFORM - name of machine you are on
(e.g. cheyenne | hera | jet | orion | wcoss2 )
EOF_USAGE
}

# Make sure machine name is passed as first argument
if [ $# -eq 0 ]; then
usage
exit 1
fi

# help message
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
usage
exit 0
fi

# Set machine name to lowercase
machine=${1,,}

# Get home directory
scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" )
scrfunc_dir=$( dirname "${scrfunc_fp}" )
HOMEdir=$( dirname "${scrfunc_dir}" )

# source version file (run) only if it is specified in versions directory
RUN_VER_FN="run_ver.${machine}"
VERSION_FILE="${HOMEdir}/versions/${RUN_VER_FN}"
if [ -f ${VERSION_FILE} ]; then
. ${VERSION_FILE}
fi

# Source modulefile for this machine
WFLOW_MOD_FN="wflow_${machine}"
source "${HOMEdir}/etc/lmod-setup.sh" ${machine}
module use "${HOMEdir}/modulefiles"
module load "${WFLOW_MOD_FN}" > /dev/null 2>&1 || { echo "ERROR:
Loading of platform-specific module file (WFLOW_MOD_FN) for the workflow
task failed:
WFLOW_MOD_FN = \"${WFLOW_MOD_FN}\""; exit 1; }

# Activate conda
[[ ${SHELLOPTS} =~ nounset ]] && has_mu=true || has_mu=false

$has_mu && set +u
if [[ "${machine}" == 'cheyenne' ]]; then
conda activate /glade/p/ral/jntp/UFS_SRW_app/conda/regional_workflow
else
if [ ! -z $(command -v conda) ]; then
conda activate regional_workflow
fi
fi
$has_mu && set -u

# List loaded modulefiles
module list

8 changes: 4 additions & 4 deletions ush/machine/cheyenne.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ platform:
RUN_CMD_POST: mpirun -np $nprocs
RUN_CMD_SERIAL: time
RUN_CMD_UTILS: mpirun -np $nprocs
ENV_INIT_SCRIPTS_FPS:
- /etc/profile
PRE_TASK_CMDS: '{ ulimit -s unlimited; ulimit -a; }'
TEST_EXTRN_MDL_SOURCE_BASEDIR: /glade/p/ral/jntp/UFS_SRW_App/develop/input_model_data
TEST_PREGEN_BASEDIR: /glade/p/ral/jntp/UFS_SRW_App/develop/FV3LAM_pregen
TEST_ALT_EXTRN_MDL_SYSBASEDIR_ICS: /glade/p/ral/jntp/UFS_SRW_App/develop/dummy_FV3GFS_sys_dir
TEST_ALT_EXTRN_MDL_SYSBASEDIR_LBCS: /glade/p/ral/jntp/UFS_SRW_App/develop/dummy_FV3GFS_sys_dir
task_make_orog:
TOPO_DIR: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_orog
task_make_sfc_climo:
SFC_CLIMO_INPUT_DIR: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_sfc_climo
task_run_fcst:
FIXaer: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_aer
FIXgsm: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_am
FIXlut: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_lut
TOPO_DIR: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_orog
SFC_CLIMO_INPUT_DIR: /glade/p/ral/jntp/UFS_SRW_App/develop/fix/fix_sfc_climo
data:
FV3GFS: /glade/p/ral/jntp/UFS_CAM/COMGFS/gfs.${yyyymmdd}/${hh}
9 changes: 4 additions & 5 deletions ush/machine/gaea.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ platform:
RUN_CMD_SERIAL: time
RUN_CMD_UTILS: srun --mpi=pmi2 -n $nprocs
SCHED_NATIVE_CMD: -M c3
ENV_INIT_SCRIPTS_FPS:
- /etc/profile
- /lustre/f2/dev/role.epic/contrib/Lmod_init.sh
PRE_TASK_CMDS: '{ ulimit -s unlimited; ulimit -a; }'
TEST_EXTRN_MDL_SOURCE_BASEDIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/input_model_data
TEST_PREGEN_BASEDIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/FV3LAM_pregen
TEST_ALT_EXTRN_MDL_SYSBASEDIR_ICS: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/dummy_FV3GFS_sys_dir
TEST_ALT_EXTRN_MDL_SYSBASEDIR_LBCS: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/dummy_FV3GFS_sys_dir
task_make_orog:
TOPO_DIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_orog
task_make_sfc_climo:
SFC_CLIMO_INPUT_DIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_sfc_climo
task_run_fcst:
FIXaer: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_aer
FIXgsm: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_am
FIXlut: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_lut
TOPO_DIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_orog
SFC_CLIMO_INPUT_DIR: /lustre/f2/pdata/ncep_shared/UFS_SRW_App/develop/fix/fix_sfc_climo
data:
FV3GFS: /lustre/f2/dev/Mark.Potts/EPIC/SRW/model_data/FV3GFS/${yyyymmdd}${hh}
8 changes: 4 additions & 4 deletions ush/machine/hera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ platform:
RUN_CMD_POST: srun
RUN_CMD_SERIAL: time
RUN_CMD_UTILS: srun
ENV_INIT_SCRIPTS_FPS:
- /etc/profile
PRE_TASK_CMDS: '{ ulimit -s unlimited; ulimit -a; }'
TEST_EXTRN_MDL_SOURCE_BASEDIR: /scratch2/BMC/det/UFS_SRW_App/develop/input_model_data
TEST_PREGEN_BASEDIR: /scratch2/BMC/det/UFS_SRW_App/develop/FV3LAM_pregen
TEST_ALT_EXTRN_MDL_SYSBASEDIR_ICS: /scratch2/BMC/det/UFS_SRW_app/develop/dummy_FV3GFS_sys_dir
TEST_ALT_EXTRN_MDL_SYSBASEDIR_LBCS: /scratch2/BMC/det/UFS_SRW_app/develop/dummy_FV3GFS_sys_dir
task_make_orog:
TOPO_DIR: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_orog
task_make_sfc_climo:
SFC_CLIMO_INPUT_DIR: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_sfc_climo
task_get_extrn_ics:
EXTRN_MDL_DATA_STORES: hpss aws nomads
task_get_extrn_lbcs:
Expand All @@ -34,5 +36,3 @@ task_run_fcst:
FIXaer: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_aer
FIXgsm: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_am
FIXlut: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_lut
TOPO_DIR: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_orog
SFC_CLIMO_INPUT_DIR: /scratch2/BMC/det/UFS_SRW_App/develop/fix/fix_sfc_climo
Loading