Skip to content
Closed
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: 1 addition & 1 deletion .cicd/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pipeline {
post {
always {
// Archive the test log files
sh 'cd "${SRW_WE2E_EXPERIMENT_BASE_DIR}" && tar --create --gzip --verbose --file "${WORKSPACE}/we2e_test_logs-${SRW_PLATFORM}-${SRW_COMPILER}.tgz" */log.generate_FV3LAM_wflow */log.launch_FV3LAM_wflow */log/*'
sh 'cd "${SRW_WE2E_EXPERIMENT_BASE_DIR}" && tar --create --gzip --verbose --dereference --file "${WORKSPACE}/we2e_test_logs-${SRW_PLATFORM}-${SRW_COMPILER}.tgz" */log.generate_FV3LAM_wflow */log.launch_FV3LAM_wflow */log/*'
// Remove the data sets from the experiments directory to conserve disk space
sh 'find "${SRW_WE2E_EXPERIMENT_BASE_DIR}" -regextype posix-extended -regex "^.*(orog|[0-9]{10})$" -type d | xargs rm -rf'
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'woc-epic-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_results-*-*.txt', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false], [bucket: 'woc-epic-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_logs-*-*.tgz', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
Expand Down
4 changes: 4 additions & 0 deletions .cicd/scripts/srw_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ fi

# Build and install
cd ${workspace}/tests
set +e
./build.sh ${platform} ${SRW_COMPILER}
build_exit=$?
set -e
cd -

# Create combined log file for upload to s3
build_dir="${workspace}/build_${SRW_COMPILER}"
cat ${build_dir}/log.cmake ${build_dir}/log.make \
>${build_dir}/srw_build-${platform}-${SRW_COMPILER}.log

exit $build_exit
27 changes: 22 additions & 5 deletions devbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ OPTIONS
does a "make clean"
--build
does a "make" (build only)
--move
move binaries to final location.
--build-dir=BUILD_DIR
build directory
--install-dir=INSTALL_DIR
Expand Down Expand Up @@ -125,6 +127,7 @@ BUILD_RRFS_UTILS="off"
# Make options
CLEAN=false
BUILD=false
MOVE=false
USE_SUB_MODULES=false #change default to true later

# process required arguments
Expand Down Expand Up @@ -155,6 +158,7 @@ while :; do
--continue=?*|--continue=) usage_error "$1 argument ignored." ;;
--clean) CLEAN=true ;;
--build) BUILD=true ;;
--move) MOVE=true ;;
--build-dir=?*) BUILD_DIR=${1#*=} ;;
--build-dir|--build-dir=) usage_error "$1 requires argument." ;;
--install-dir=?*) INSTALL_DIR=${1#*=} ;;
Expand Down Expand Up @@ -398,18 +402,31 @@ module list
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}

printf "... Generate CMAKE configuration ...\n"
cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake

if [ "${CLEAN}" = true ]; then
printf "... Clean executables ...\n"
make ${MAKE_SETTINGS} clean 2>&1 | tee log.make
if [ -f $PWD/Makefile ]; then
printf "... Clean executables ...\n"
make ${MAKE_SETTINGS} clean 2>&1 | tee log.make
fi
elif [ "${BUILD}" = true ]; then
printf "... Generate CMAKE configuration ...\n"
cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake

printf "... Compile executables ...\n"
make ${MAKE_SETTINGS} build 2>&1 | tee log.make
else
printf "... Generate CMAKE configuration ...\n"
cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake

printf "... Compile and install executables ...\n"
make ${MAKE_SETTINGS} install 2>&1 | tee log.make

if [ "${MOVE}" = true ]; then
if [[ ! ${SRW_DIR} -ef ${INSTALL_DIR} ]]; then
printf "... Moving executables to final locations ...\n"
mkdir -p ${SRW_DIR}/${BIN_DIR}
mv ${INSTALL_DIR}/${BIN_DIR}/* ${SRW_DIR}/${BIN_DIR}
fi
fi
fi

exit 0
4 changes: 3 additions & 1 deletion devclean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ elif [ "${CLEAN}" = true ]; then
printf '%s\n' " from the installation directory = ${INSTALL_DIR} "
[[ -d "${BUILD_DIR}" ]] && rm -rf ${BUILD_DIR} && printf '%s\n' "rm -rf ${BUILD_DIR}"
[[ -d "${INSTALL_DIR}/${BIN_DIR}" ]] && ( rm -rf ${INSTALL_DIR}/${BIN_DIR} && printf '%s\n' "rm -rf ${INSTALL_DIR}/${BIN_DIR}" )
[[ -d "${INSTALL_DIR}/lib" ]] && ( rm -rf ${INSTALL_DIR}/share && printf '%s\n' "rm -rf ${INSTALL_DIR}/share" )
[[ -d "${SRW_DIR}/${BIN_DIR}" ]] && ( rm -rf ${SRW_DIR}/${BIN_DIR} && printf '%s\n' "rm -rf ${SRW_DIR}/${BIN_DIR}" )
[[ -d "${INSTALL_DIR}/share" ]] && ( rm -rf ${INSTALL_DIR}/share && printf '%s\n' "rm -rf ${INSTALL_DIR}/share" )
[[ -d "${INSTALL_DIR}/include" ]] && ( rm -rf ${INSTALL_DIR}/include && printf '%s\n' "rm -rf ${INSTALL_DIR}/include" )
[[ -d "${INSTALL_DIR}/lib" ]] && rm -rf ${INSTALL_DIR}/lib && printf '%s\n' "rm -rf ${INSTALL_DIR}/lib"
[[ -d "${INSTALL_DIR}/lib64" ]] && rm -rf ${INSTALL_DIR}/lib && printf '%s\n' "rm -rf ${INSTALL_DIR}/lib64"
[[ -d "${SRW_DIR}/manage_externals/manic" ]] && rm -f ${SRW_DIR}/manage_externals/manic/*.pyc && printf '%s\n' "rm -f ${SRW_DIR}/manage_externals/manic/*.pyc"
echo " "
fi
Expand Down
5 changes: 3 additions & 2 deletions etc/lmod-setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ endif
source /etc/csh.login

if ( "$L_MACHINE" == macos ) then
set ENV="/opt/homebrew/opt/lmod/init/csh"
# setenv ENV "/usr/local/opt/lmod/init/csh"
arch=$(uname -m)
[[ "$arch" = arm64 ]] && export ENV="/opt/homebrew/opt/lmod/init/csh"
[[ "$arch" = x86_64 ]] && export ENV="/usr/local/opt/lmod/init/csh"
source $ENV

module purge
Expand Down
5 changes: 3 additions & 2 deletions etc/lmod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ $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"
arch=$(uname -m)
[[ "$arch" = arm64 ]] && export BASH_ENV="/opt/homebrew/opt/lmod/init/bash"
[[ "$arch" = x86_64 ]] && export BASH_ENV="/usr/local/opt/lmod/init/bash"
source $BASH_ENV

module purge
Expand Down
28 changes: 19 additions & 9 deletions jobs/JREGIONAL_GET_EXTRN_MDL_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ check_var_valid_value "ICS_OR_LBCS" "valid_vals_ICS_OR_LBCS"
if [ "${ICS_OR_LBCS}" = "ICS" ]; then
export TIME_OFFSET_HRS=${EXTRN_MDL_ICS_OFFSET_HRS:-0}
export EXTRN_MDL_NAME=${EXTRN_MDL_NAME_ICS}

GFS_FILE_FMT=${FV3GFS_FILE_FMT_ICS}
elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
export TIME_OFFSET_HRS=${EXTRN_MDL_LBCS_OFFSET_HRS:-0}
export EXTRN_MDL_NAME=${EXTRN_MDL_NAME_LBCS}
GFS_FILE_FMT=${FV3GFS_FILE_FMT_LBCS}
fi

#
Expand Down Expand Up @@ -159,10 +160,10 @@ case ${EXTRN_MDL_NAME} in
# The transition date from the GSMGFS to the FV3GFS was 2019061212, i.e.
# this was the first official forecast with the FV3GFS. So we set the
# last CDATE for the GSMGFS to the one 6 hours before this.
cdate_max="2019061206"
if [ "$EXTRN_MDL_CDATE" -gt "$cdate_max" ]; then
CDATE_max="2019061206"
if [ "$EXTRN_MDL_CDATE" -gt "$CDATE_max" ]; then
print_err_msg_exit "\
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_max max)"
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_max max)"
fi
;;

Expand All @@ -171,11 +172,20 @@ case ${EXTRN_MDL_NAME} in
# this was the first official forecast with the FV3GFS. However, paral-
# lel runs with the FV3GFS go back to 2018121500. So we set the first
# EXTRN_MDL_CDATE for the FV3GFS to this date and time.
# CDATE_min="2019061212"
CDATE_min="2018121500"
CDATE_min_netcdf="2021032100"
CDATE_max_nemsio="2021032018"
if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)"
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)"
elif [ "${GFS_FILE_FMT}" = "netcdf" ] && [ "${EXTRN_MDL_CDATE}" -lt "${CDATE_min_netcdf}" ]; then
print_err_msg_exit "\
NETCDF is not available for this date:: However, NEMSIO is available:: \
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min_netcdf min)"
elif [ "${GFS_FILE_FMT}" = "nemsio" ] && [ "${EXTRN_MDL_CDATE}" -gt "${CDATE_max_nemsio}" ]; then
print_err_msg_exit "\
NEMSIO is not available for this date:: However, NETCDF is available:: \
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_max_nemsio max)"
fi
;;

Expand All @@ -185,7 +195,7 @@ case ${EXTRN_MDL_NAME} in
CDATE_min="2015070100"
if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)"
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)"
fi
;;

Expand All @@ -196,7 +206,7 @@ case ${EXTRN_MDL_NAME} in
CDATE_min="2014103000"
if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)"
$(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)"
fi
;;

Expand All @@ -209,7 +219,7 @@ esac
#-----------------------------------------------------------------------
#
if [ $RUN_ENVIR = "nco" ]; then
export EXTRN_MDL_STAGING_DIR="${COMIN}/for_${ICS_OR_LBCS}"
export EXTRN_MDL_STAGING_DIR="${COMINext}"
mkdir_vrfy -p "${EXTRN_MDL_STAGING_DIR}"
else
export EXTRN_MDL_STAGING_DIR="${COMIN}/${EXTRN_MDL_NAME}/for_${ICS_OR_LBCS}"
Expand Down
2 changes: 1 addition & 1 deletion jobs/JREGIONAL_RUN_FCST
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
. ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/source_util_funcs.sh
. $USHdir/job_preamble.sh
. $USHdir/job_preamble.sh "TRUE"
#
#-----------------------------------------------------------------------
#
Expand Down
61 changes: 16 additions & 45 deletions modulefiles/build_macos_gnu.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
help([[
This module needs to be customized for the user's Linux environment:
This module needs to be customized for the user's MacOS environment:
specify compilers, path for HPC-stack, load the modules, set compiler and linker flags
Option 1: M1/arm64 platform, OS BigSur, Monterey (Darwin 20,21)
Option 2: Intel/x86_64 platform, OS Catalina (Darwin 19)
]])

whatis([===[Loads libraries needed for building the UFS SRW App on macos ]===])
Expand All @@ -23,48 +21,21 @@ load("hpc-gnu")
load("openmpi")
load("hpc-openmpi")

load("jasper/2.0.25")
load("zlib/1.2.11")

load("hdf5/1.10.6")
load("netcdf/4.7.4")
load("pio/2.5.3")
load("esmf/8.3.0b09")
load("fms/2022.01")

load("bacio/2.4.1")
load("crtm/2.3.0")
load("g2/3.4.3")
load("g2tmpl/1.10.0")
load("ip/3.3.3")
load("sp/2.3.3")
load("w3nco/2.4.1")
load("upp/10.0.10")

load("gftl-shared/1.3.3")
load("yafyaml/0.5.1")
load("mapl/2.12.2-esmf-8.3.0b09")
load("gfsio/1.4.1")
load("landsfcutil/2.4.1")
load("nemsio/2.5.4")
load("nemsiogfs/2.5.3")
load("sfcio/1.4.1")
load("sigio/2.3.2")
load("w3emc/2.9.2")
load("wgrib2/2.0.8")

-- Option 1 compiler paths:
setenv("CC", "/opt/homebrew/bin/gcc")
setenv("FC", "/opt/homebrew/bin/gfortran")
setenv("CXX", "/opt/homebrew/bin/g++")

-- Option 2 compiler paths:
--[[
setenv("CC", "/usr/local/bin/gcc")
setenv("FC", "/usr/local/bin/gfortran")
setenv("CXX", "/usr/local/bin/g++")
--]]
--
load("srw_common")

-- MacOS with arm64 architecture: `uname -m` expands to arm64
-- MacOS with Intel architecture: `uname -m` expands to x86_64
local arch = 'eval $(uname -m)'
if (arch == "arm64") then
setenv("CC", "/opt/homebrew/bin/gcc")
setenv("FC", "/opt/homebrew/bin/gfortran")
setenv("CXX", "/opt/homebrew/bin/g++")
else
setenv("CC", "/usr/local/bin/gcc")
setenv("FC", "/usr/local/bin/gfortran")
setenv("CXX", "/usr/local/bin/g++")
end

-- Set MPI compilers depending on the MPI libraries built:
local MPI_CC="mpicc"
local MPI_CXX="mpicxx"
Expand Down
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/get_extrn_ics.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/get_extrn_lbcs.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/get_obs.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/make_grid.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/make_ics.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/make_lbcs.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/make_sfc_climo.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 3 additions & 0 deletions modulefiles/tasks/wcoss2/python_regional_workflow.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load(pathJoin("prod_util", os.getenv("prod_util_ver")))
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/run_fcst.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
3 changes: 1 addition & 2 deletions modulefiles/tasks/wcoss2/run_vx.local.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load("python_regional_workflow")
17 changes: 6 additions & 11 deletions modulefiles/wflow_macos.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
help([[
This module activates python environement for running the UFS SRW App on general macOS
This module set a path needed to activate conda environement for running UFS SRW App on general macOS
]])

whatis([===[This module activates python environment for running the UFS SRW App on macOS]===])
whatis([===[This module activates conda environment for running the UFS SRW App on macOS]===])

setenv("CMAKE_Platform", "macos")
setenv("VENV", pathJoin(os.getenv("HOME"), "venv/regional_workflow"))
setenv("VENV", pathJoin(os.getenv("HOME"), "condaenv/envs/regional_workflow"))

--[[
local ROCOTOmod="/Users/username/modules"
Expand All @@ -14,13 +14,8 @@ load(rocoto)
--]]

if mode() == "load" then
LmodMsgRaw([===[Verify the Python virtual environment path \$VENV shown below is correct, "
set to the correct path otherwise: "
VENV=$env(VENV) "
Please do the following to activate python virtual environment:
> source \$VENV/bin/activate "
LmodMsgRaw([===[Please do the following to activate conda virtual environment:
> conda activate $VENV "
]===])
end
if mode() == "unload" then
execute{cmd="deactivate", modeA={"unload"}}
end

Loading