-
Notifications
You must be signed in to change notification settings - Fork 210
Allow building of the ufs-weather-model, WW3 pre/post execs for GFS, GEFS, SFS in the same clone of global-workflow #3098
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
Merged
WalterKolczynski-NOAA
merged 37 commits into
NOAA-EMC:develop
from
aerorahul:feature/multi_model_build
Dec 16, 2024
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
1c5b14b
allow building multiple ufs_model.x for gfs, gefs and sfs
aerorahul 98f26a8
use SFS_POST as a proxy for SFS
aerorahul 041e7e1
link/copy the appropriate model executable
aerorahul e886c38
Merge branch 'develop' into feature/multi_model_build
aerorahul e536a3a
create gfs/gefs versions of ww3 pre/post execs
aerorahul 2a9f12b
Merge branch 'develop' into feature/multi_model_build
aerorahul b8eb15d
use NET specific executable names
aerorahul f0bf57c
fix errors detected by shellnorms
aerorahul 3bd366a
one shellnorm error escaped
aerorahul b102c07
one shellnorm error escaped
aerorahul c26da40
Merge branch 'develop' into feature/multi_model_build
aerorahul 8bee97c
minor fixes for typos and such
aerorahul 612ef35
update Jenkinsfile to build in a single location and use it
aerorahul 080186a
remove build matrix from Jenkinsfile
aerorahul f8e3d6a
fix shellnorm found issue
aerorahul fc41b6d
fix shellnorm found issue by disabling it
aerorahul c61ff88
fix not changed shellcheck detected error
aerorahul 200d6bd
add comment back in ww3prepost build script
aerorahul 37d1fb9
Update ush/wave_grid_interp_sbs.sh
aerorahul ab66442
Update sorc/link_workflow.sh
aerorahul dae774a
Update ush/wave_grid_interp_sbs.sh
aerorahul 1d47c9e
Update ush/wave_prnc_cur.sh
aerorahul b136b8a
Update ush/wave_prnc_ice.sh
aerorahul ebf6176
Update scripts/exgfs_wave_post_pnt.sh
aerorahul 93ad4bf
Update ush/wave_outp_spec.sh
aerorahul ea41c19
Merge branch 'develop' into feature/multi_model_build
aerorahul b5ede8b
capture stdout/stderr from Jenkinsbuild for gefs variants. Also, was…
aerorahul 4531678
Update sorc/link_workflow.sh
aerorahul 842e717
Update sorc/build_ufs.sh
aerorahul c1e01f8
Update sorc/link_workflow.sh
aerorahul d3e76a6
Update sorc/link_workflow.sh
aerorahul be0ca2c
since using single build location, GEFS wcoss testing can be enabled
aerorahul c37409d
update Jenkinsfile to try to do scm checkout if it fails the first time;
aerorahul 5079448
undo the fix and reintroduce the incorrect logic. Fixing the bug ope…
aerorahul ee90bec
Merge branch 'develop' into feature/multi_model_build
aerorahul 387b8dc
Merge branch 'develop' into feature/multi_model_build
aerorahul a901aee
Merge branch 'develop' into feature/multi_model_build
aerorahul 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -18,4 +18,4 @@ arguments: | |
| yaml: {{ HOMEgfs }}/ci/cases/yamls/gefs_defaults_ci.yaml | ||
|
|
||
| skip_ci_on_hosts: | ||
| - wcoss2 | ||
| - None | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -19,4 +19,4 @@ arguments: | |
| icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96mx100/20240610 | ||
|
|
||
| skip_ci_on_hosts: | ||
| - wcoss2 | ||
| - None | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,132 +1,107 @@ | ||
| #! /usr/bin/env bash | ||
| set -x | ||
|
|
||
| script_dir=$(dirname "${BASH_SOURCE[0]}") | ||
| cd "${script_dir}" || exit 1 | ||
| # shellcheck disable=SC2312 | ||
| _HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) | ||
|
|
||
| cd "${_HOMEgfs}/sorc" || exit 1 | ||
|
|
||
| # Default settings | ||
| APP="S2SWA" | ||
| PDLIB="ON" | ||
|
|
||
| while getopts ":j:a:dvw" option; do | ||
| case "${option}" in | ||
| a) APP="${OPTARG}";; | ||
| d) BUILD_TYPE="Debug";; | ||
| j) BUILD_JOBS="${OPTARG}";; | ||
| v) export BUILD_VERBOSE="YES";; | ||
| w) PDLIB="OFF";; | ||
| :) | ||
| echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" | ||
| usage | ||
| ;; | ||
| *) | ||
| echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}" | ||
| usage | ||
| ;; | ||
| d) BUILD_TYPE="Debug" ;; | ||
| j) BUILD_JOBS="${OPTARG}" ;; | ||
| v) export BUILD_VERBOSE="YES" ;; | ||
| w) PDLIB="OFF" ;; | ||
| :) | ||
| echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" | ||
| usage | ||
| ;; | ||
| *) | ||
| echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}" | ||
| usage | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| # Determine which switch to use | ||
| if [[ "${APP}" == "ATMW" ]]; then | ||
| ww3switch="model/esmf/switch" | ||
|
aerorahul marked this conversation as resolved.
|
||
| else | ||
| if [[ "${PDLIB}" == "ON" ]]; then | ||
| ww3switch="model/bin/switch_meshcap_pdlib" | ||
| else | ||
| ww3switch="model/bin/switch_meshcap" | ||
| fi | ||
| fi | ||
|
|
||
| # Check final exec folder exists | ||
| if [[ ! -d "../exec" ]]; then | ||
| mkdir ../exec | ||
| fi | ||
|
|
||
| finalexecdir="$( pwd -P )/../exec" | ||
|
|
||
| #Determine machine and load modules | ||
| # Determine machine and load modules | ||
| set +x | ||
| source "${script_dir}/ufs_model.fd/tests/detect_machine.sh" | ||
| source "${script_dir}/ufs_model.fd/tests/module-setup.sh" | ||
| module use "${script_dir}/ufs_model.fd/modulefiles" | ||
| source "${_HOMEgfs}/sorc/ufs_model.fd/tests/detect_machine.sh" | ||
| source "${_HOMEgfs}/sorc/ufs_model.fd/tests/module-setup.sh" | ||
| module use "${_HOMEgfs}/sorc/ufs_model.fd/modulefiles" | ||
| module load "ufs_${MACHINE_ID}.intel" | ||
| set -x | ||
|
|
||
| #Set WW3 directory, switch, prep and post exes | ||
| cd ufs_model.fd/WW3 || exit 1 | ||
| WW3_DIR=$( pwd -P ) | ||
| #Set WW3 directory | ||
| cd "${_HOMEgfs}/sorc/ufs_model.fd/WW3" || exit 1 | ||
| WW3_DIR=$(pwd -P) | ||
| export WW3_DIR | ||
| export SWITCHFILE="${WW3_DIR}/${ww3switch}" | ||
|
|
||
| # Build exes for prep jobs and post jobs: | ||
| prep_exes="ww3_grid ww3_prep ww3_prnc ww3_grid" | ||
| post_exes="ww3_outp ww3_outf ww3_outp ww3_gint ww3_ounf ww3_ounp ww3_grib" | ||
| # Determine which switch to use | ||
| if [[ "${PDLIB}" == "ON" ]]; then | ||
| ww3switch="model/bin/switch_meshcap_pdlib" | ||
| path_build="${WW3_DIR}/build/pdlib_ON" | ||
| path_install="${WW3_DIR}/install/pdlib_ON" | ||
| else | ||
| ww3switch="model/bin/switch_meshcap" | ||
| path_build="${WW3_DIR}/build/pdlib_OFF" | ||
| path_install="${WW3_DIR}/install/pdlib_OFF" | ||
| fi | ||
| export SWITCHFILE="${WW3_DIR}/${ww3switch}" | ||
|
|
||
| #create build directory: | ||
| path_build="${WW3_DIR}/build_SHRD" | ||
| [[ -d "${path_build}" ]] && rm -rf "${path_build}" | ||
| mkdir -p "${path_build}" || exit 1 | ||
| cd "${path_build}" || exit 1 | ||
| echo "Forcing a SHRD build" | ||
|
aerorahul marked this conversation as resolved.
|
||
|
|
||
| buildswitch="${path_build}/switch" | ||
|
|
||
| cat "${SWITCHFILE}" > "${path_build}/tempswitch" | ||
|
|
||
| sed -e "s/DIST/SHRD/g"\ | ||
| -e "s/OMPG / /g"\ | ||
| -e "s/OMPH / /g"\ | ||
| -e "s/MPIT / /g"\ | ||
| -e "s/MPI / /g"\ | ||
| -e "s/PIO / /g"\ | ||
| -e "s/B4B / /g"\ | ||
| -e "s/PDLIB / /g"\ | ||
| -e "s/SCOTCH / /g"\ | ||
| -e "s/METIS / /g"\ | ||
| -e "s/NOGRB/NCEP2/g"\ | ||
| "${path_build}/tempswitch" > "${path_build}/switch" | ||
| cat "${SWITCHFILE}" >"${path_build}/tempswitch" | ||
|
|
||
| sed -e "s/DIST/SHRD/g" \ | ||
| -e "s/OMPG / /g" \ | ||
| -e "s/OMPH / /g" \ | ||
| -e "s/MPIT / /g" \ | ||
| -e "s/MPI / /g" \ | ||
| -e "s/PIO / /g" \ | ||
| -e "s/B4B / /g" \ | ||
| -e "s/PDLIB / /g" \ | ||
| -e "s/SCOTCH / /g" \ | ||
| -e "s/METIS / /g" \ | ||
| -e "s/NOGRB/NCEP2/g" \ | ||
| "${path_build}/tempswitch" >"${path_build}/switch" | ||
| rm "${path_build}/tempswitch" | ||
|
|
||
| echo "Switch file is ${buildswitch} with switches:" | ||
| cat "${buildswitch}" | ||
|
|
||
| #define cmake build options | ||
| MAKE_OPT="-DCMAKE_INSTALL_PREFIX=install" | ||
| MAKE_OPT="-DCMAKE_INSTALL_PREFIX=${path_install}" | ||
| [[ ${BUILD_TYPE:-"Release"} = "Debug" ]] && MAKE_OPT+=" -DCMAKE_BUILD_TYPE=Debug" | ||
|
|
||
| #Build executables: | ||
| # shellcheck disable=SC2086 | ||
| cmake "${WW3_DIR}" -DSWITCH="${buildswitch}" ${MAKE_OPT} | ||
| rc=$? | ||
| if (( rc != 0 )); then | ||
| if ((rc != 0)); then | ||
| echo "Fatal error in cmake." | ||
| exit "${rc}" | ||
| fi | ||
|
|
||
| make -j "${BUILD_JOBS:-8}" | ||
| rc=$? | ||
| if (( rc != 0 )); then | ||
| if ((rc != 0)); then | ||
| echo "Fatal error in make." | ||
| exit "${rc}" | ||
| fi | ||
|
|
||
| make install | ||
| if (( rc != 0 )); then | ||
| rc=$? | ||
| if ((rc != 0)); then | ||
| echo "Fatal error in make install." | ||
| exit "${rc}" | ||
| fi | ||
|
|
||
| # Copy to top-level exe directory | ||
| for prog in ${prep_exes} ${post_exes}; do | ||
| cp "${path_build}/install/bin/${prog}" "${finalexecdir}/" | ||
|
JessicaMeixner-NOAA marked this conversation as resolved.
|
||
| rc=$? | ||
| if (( rc != 0 )); then | ||
| echo "FATAL: Unable to copy ${path_build}/${prog} to ${finalexecdir} (Error code ${rc})" | ||
| exit "${rc}" | ||
| fi | ||
| done | ||
|
|
||
| #clean-up build directory: | ||
| echo "executables are in ${finalexecdir}" | ||
| echo "cleaning up ${path_build}" | ||
| rm -rf "${path_build}" | ||
|
|
||
| exit 0 | ||
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.
Uh oh!
There was an error while loading. Please reload this page.