-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[develop] Integrate 'online-cmaq' into 'develop' branch: Part 2, build script and module files #549
Merged
MichaelLueken
merged 16 commits into
ufs-community:develop
from
chan-hoo:feature/aqm_part2
Feb 10, 2023
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
74c9f3f
aqm build and module files
90d5076
update hash of ufs weather model and aqm utils
37ff3cf
add missing sorc/CMakeLists.txt
fd03170
add version file for hera
chan-hoo d04f66a
back to original version in srw_common
chan-hoo 0e695d1
update jjob and ex scripts
e2489d0
remove externals check-out from devbuild
chan-hoo b976eee
put extra components for online-cmaq into Externals.cfg
chan-hoo 1cbe10d
update path to stacks
chan-hoo 725adc3
fix modulefile for gaea
chan-hoo cd6c89f
update ex-scripts
cfd2df4
add missing module file for pre_post_stat on Hera
chan-hoo 50e71f6
Merge branch 'develop' of https://github.com/chan-hoo/ufs-srweather-a…
chan-hoo bd8064a
update scripts
chan-hoo 3bb744f
Update modulefiles to use EPIC maintained locations and address Hera …
MichaelLueken e355b63
move build selection part and clean up module
chan-hoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ OPTIONS | |
compiler to use; default depends on platform | ||
(e.g. intel | gnu | cray | gccgfortran) | ||
-a, --app=APPLICATION | ||
weather model application to build | ||
(e.g. ATM | ATMW | S2S | S2SW) | ||
weather model application to build; for example, ATMAQ for Online-CMAQ | ||
(e.g. ATM | ATMAQ | ATMW | S2S | S2SW) | ||
--ccpp="CCPP_SUITE1,CCPP_SUITE2..." | ||
CCPP suites (CCPP_SUITES) to include in build; delimited with ',' | ||
--enable-options="OPTION1,OPTION2,..." | ||
|
@@ -56,8 +56,7 @@ TARGETS | |
all = builds all apps | ||
Or any combinations of (ufs, ufs_utils, upp, gsi, rrfs_utils) | ||
|
||
NOTE: This script is for internal developer use only; | ||
See User's Guide for detailed build instructions | ||
NOTE: See User's Guide for detailed build instructions | ||
|
||
EOF_USAGE | ||
} | ||
|
@@ -87,6 +86,8 @@ Settings: | |
BUILD_UPP=${BUILD_UPP} | ||
BUILD_GSI=${BUILD_GSI} | ||
BUILD_RRFS_UTILS=${BUILD_RRFS_UTILS} | ||
BUILD_NEXUS=${BUILD_NEXUS} | ||
BUILD_AQM_UTILS=${BUILD_AQM_UTILS} | ||
|
||
EOF_SETTINGS | ||
} | ||
|
@@ -123,6 +124,8 @@ BUILD_UFS_UTILS="off" | |
BUILD_UPP="off" | ||
BUILD_GSI="off" | ||
BUILD_RRFS_UTILS="off" | ||
BUILD_NEXUS="off" | ||
BUILD_AQM_UTILS="off" | ||
|
||
# Make options | ||
CLEAN=false | ||
|
@@ -182,36 +185,52 @@ while :; do | |
upp) DEFAULT_BUILD=false; BUILD_UPP="on" ;; | ||
gsi) DEFAULT_BUILD=false; BUILD_GSI="on" ;; | ||
rrfs_utils) DEFAULT_BUILD=false; BUILD_RRFS_UTILS="on" ;; | ||
nexus) DEFAULT_BUILD=false; BUILD_NEXUS="on" ;; | ||
aqm_utils) DEFAULT_BUILD=false; BUILD_AQM_UTILS="on" ;; | ||
# unknown | ||
-?*|?*) usage_error "Unknown option $1" ;; | ||
*) break | ||
esac | ||
shift | ||
done | ||
|
||
# choose default apps to build | ||
if [ "${DEFAULT_BUILD}" = true ]; then | ||
BUILD_UFS="on" | ||
BUILD_UFS_UTILS="on" | ||
BUILD_UPP="on" | ||
fi | ||
|
||
# Ensure uppercase / lowercase ============================================ | ||
APPLICATION="${APPLICATION^^}" | ||
PLATFORM="${PLATFORM,,}" | ||
COMPILER="${COMPILER,,}" | ||
EXTERNALS="${EXTERNALS^^}" | ||
|
||
# check if PLATFORM is set | ||
if [ -z $PLATFORM ] ; then | ||
printf "\nERROR: Please set PLATFORM.\n\n" | ||
usage | ||
exit 0 | ||
fi | ||
|
||
# set PLATFORM (MACHINE) | ||
MACHINE="${PLATFORM}" | ||
printf "PLATFORM(MACHINE)=${PLATFORM}\n" >&2 | ||
|
||
# choose default apps to build | ||
if [ "${DEFAULT_BUILD}" = true ]; then | ||
BUILD_UFS="on" | ||
BUILD_UFS_UTILS="on" | ||
BUILD_UPP="on" | ||
fi | ||
|
||
# Choose components to build for Online-CMAQ | ||
if [ "${APPLICATION}" = "ATMAQ" ]; then | ||
if [ "${DEFAULT_BUILD}" = true ]; then | ||
BUILD_NEXUS="on" | ||
BUILD_AQM_UTILS="on" | ||
BUILD_UPP="off" | ||
fi | ||
if [ "${PLATFORM}" = "wcoss2" ]; then | ||
BUILD_POST_STAT="on" | ||
else | ||
BUILD_POST_STAT="off" | ||
fi | ||
fi | ||
|
||
set -eu | ||
|
||
# automatically determine compiler | ||
|
@@ -304,7 +323,8 @@ CMAKE_SETTINGS="\ | |
-DBUILD_UFS_UTILS=${BUILD_UFS_UTILS}\ | ||
-DBUILD_UPP=${BUILD_UPP}\ | ||
-DBUILD_GSI=${BUILD_GSI}\ | ||
-DBUILD_RRFS_UTILS=${BUILD_RRFS_UTILS}" | ||
-DBUILD_NEXUS=${BUILD_NEXUS}\ | ||
-DBUILD_AQM_UTILS=${BUILD_AQM_UTILS}" | ||
|
||
if [ ! -z "${APPLICATION}" ]; then | ||
CMAKE_SETTINGS="${CMAKE_SETTINGS} -DAPP=${APPLICATION}" | ||
|
@@ -318,6 +338,29 @@ fi | |
if [ ! -z "${DISABLE_OPTIONS}" ]; then | ||
CMAKE_SETTINGS="${CMAKE_SETTINGS} -DDISABLE_OPTIONS=${DISABLE_OPTIONS}" | ||
fi | ||
if [ "${APPLICATION}" = "ATMAQ" ]; then | ||
CMAKE_SETTINGS="${CMAKE_SETTINGS} -DCPL_AQM=ON -DBUILD_POST_STAT=${BUILD_POST_STAT}" | ||
|
||
# Copy module files to designated directory | ||
EXTRN_BUILD_MOD_DIR="${SRW_DIR}/modulefiles/extrn_comp_build" | ||
mkdir -p ${EXTRN_BUILD_MOD_DIR} | ||
if [ "${BUILD_UFS}" = "on" ]; then | ||
cp "${SRW_DIR}/sorc/ufs-weather-model/modulefiles/ufs_${PLATFORM}.${COMPILER}.lua" "${EXTRN_BUILD_MOD_DIR}/mod_ufs-weather-model.lua" | ||
cp "${SRW_DIR}/sorc/ufs-weather-model/modulefiles/ufs_common.lua" ${EXTRN_BUILD_MOD_DIR} | ||
fi | ||
if [ "${BUILD_UFS_UTILS}" = "on" ]; then | ||
cp "${SRW_DIR}/sorc/UFS_UTILS/modulefiles/build.${PLATFORM}.${COMPILER}.lua" "${EXTRN_BUILD_MOD_DIR}/mod_ufs-utils.lua" | ||
fi | ||
if [ "${BUILD_UPP}" = "on" ]; then | ||
cp "${SRW_DIR}/sorc/UPP/modulefiles/${PLATFORM}.lua" "${EXTRN_BUILD_MOD_DIR}/mod_upp.lua" | ||
fi | ||
if [ "${BUILD_NEXUS}" = "on" ]; then | ||
cp "${SRW_DIR}/sorc/AQM-utils/parm/nexus_modulefiles/${PLATFORM}.${COMPILER}.lua" "${EXTRN_BUILD_MOD_DIR}/mod_nexus.lua" | ||
fi | ||
if [ "${BUILD_AQM_UTILS}" = "on" ]; then | ||
cp "${SRW_DIR}/sorc/AQM-utils/modulefiles/build_${PLATFORM}.${COMPILER}.lua" "${EXTRN_BUILD_MOD_DIR}/mod_aqm-utils.lua" | ||
fi | ||
fi | ||
|
||
# make settings | ||
MAKE_SETTINGS="-j ${BUILD_JOBS}" | ||
|
@@ -393,6 +436,16 @@ if [ $USE_SUB_MODULES = true ]; then | |
printf "... Loading RRFS_UTILS modules ...\n" | ||
load_module "" | ||
fi | ||
if [ $BUILD_NEXUS = "on" ]; then | ||
printf "... Loading NEXUS modules ...\n" | ||
module use ${SRW_DIR}/sorc/arl_nexus/modulefiles | ||
load_module "" | ||
fi | ||
if [ $BUILD_AQM_UTILS = "on" ]; then | ||
printf "... Loading AQM-utils modules ...\n" | ||
module use ${SRW_DIR}/sorc/AQM-utils/modulefiles | ||
load_module "" | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad to see this is not forgotten! Unfortunately SRW does not compile properly using component modulefiles instead of the top-level modulefiles. |
||
else | ||
module use ${SRW_DIR}/modulefiles | ||
module load ${MODULE_FILE} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load("miniconda_online-cmaq") | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load("hpss") | ||
load("miniconda_regional_workflow") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
prepend_path("MODULEPATH", "/contrib/miniconda3/modulefiles") | ||
load(pathJoin("miniconda3", os.getenv("miniconda3_ver") or "4.12.0")) | ||
|
||
setenv("AQM_ENV_FP", "/scratch2/NCEPDEV/naqfc/RRFS_CMAQ/PY_VENV") | ||
setenv("AQM_ENV", "online-cmaq") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) | ||
load("miniconda_online-cmaq") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load("hpss") | ||
load("miniconda_regional_workflow") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load("miniconda_online-cmaq") | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
load("miniconda_online-cmaq") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load(pathJoin("nco", os.getenv("nco_ver") or "4.9.3")) | ||
load("miniconda_online-cmaq") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this subdirectory you setup under modulefies is for later use for running workflows, because it doesn't seem to be used during build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. NCO doesn't want to load all the modules when each task runs. So, the module file of each component is copied to this subdirectory
extrn_comp_build
and it is loaded only when it is necessary.