Skip to content

Commit

Permalink
Update component versions (#851)
Browse files Browse the repository at this point in the history
Updates the version of components except UFS and verify to the current tip of their respective develop branches.
    
Verify is not yet updated because we are currently on a branch that hasn't been merged to develop yet in order to use the module/py environment fix.
    
GSI will still need to be updated further before use after the resolution of NOAA-EMC/GSI/issues/348

Also updated the GSI and UPP build scripts to take in debug (`-d`), operations (`-o`), and verbose (`-v`) options and apply them as appropriate to the component build scripts. The ops flag for GSI still needs work, as I encountered issues using the [build_4nco_global.sh](https://github.com/NOAA-EMC/GSI/blob/develop/ush/build_4nco_global.sh) or [prune_4nco_global.sh](https://github.com/NOAA-EMC/GSI/blob/develop/ush/prune_4nco_global.sh) scripts.

Also fixes a typo in the `parm/post` file list.

Updates are in preparation for the [COM reorg](#761)
  • Loading branch information
WalterKolczynski-NOAA authored Jun 27, 2022
1 parent 2dc2af0 commit 65cdcce
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 56 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ fix/wafs
parm/config/config.base
parm/gldas
parm/mon
parm/post/AEROSOL_LUTS.datoptics_luts_DUST.dat
parm/post/AEROSOL_LUTS.dat
parm/post/optics_luts_DUST.dat
parm/post/gtg.config.gfs
parm/post/gtg_imprintings.txt
parm/post/optics_luts_SALT.dat
Expand Down Expand Up @@ -76,6 +77,7 @@ sorc/gfs_post.fd
sorc/gfs_wafs.fd
sorc/gldas.fd
sorc/gsi.fd
sorc/gsi_monitor.fd
sorc/ufs_utils.fd
sorc/verif-global.fd

Expand Down
16 changes: 16 additions & 0 deletions modulefiles/gsi_monitor.hera.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
help([[
Build environment for GSI monitor on Hera
]])

prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack")

load(pathJoin("hpc", "1.1.0"))
load(pathJoin("hpc-intel", "18.0.5.274"))
load(pathJoin("hpc-impi", "2018.0.4"))

load(pathJoin("cmake", "3.20.1"))

load(pathJoin("hdf5", "1.10.6"))
load(pathJoin("netcdf", "4.7.4"))

load(pathJoin("w3emc", "2.9.1"))
16 changes: 16 additions & 0 deletions modulefiles/gsi_monitor.orion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
help([[
Build environment for GSI monitor on Orion
]])

prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack")

load(pathJoin("hpc", "1.1.0"))
load(pathJoin("hpc-intel", "2018.4"))
load(pathJoin("hpc-impi", "2018.4"))

load(pathJoin("cmake", "3.22.1"))

load(pathJoin("hdf5", "1.10.6"))
load(pathJoin("netcdf", "4.7.4"))

load(pathJoin("w3emc", "2.9.1"))
16 changes: 16 additions & 0 deletions modulefiles/gsi_monitor.wcoss_dell_p3.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
help([[
Build environment for GSI monitor on WCOSS Dell
]])

prepend_path("MODULEPATH", "/usrx/local/nceplibs/dev/hpc-stack/libs/hpc-stack/modulefiles/stack")

load(pathJoin("hpc", "1.1.0"))
load(pathJoin("hpc-ips", "18.0.1.163"))
load(pathJoin("hpc-impi", "18.0.1"))

load(pathJoin("cmake", "3.20.2"))

load(pathJoin("hdf5", "1.10.6"))
load(pathJoin("netcdf", "4.7.4"))

load(pathJoin("w3emc", "2.9.1"))
2 changes: 1 addition & 1 deletion modulefiles/workflow_utils.wcoss_dell_p3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load(pathJoin("hpc", "1.1.0"))
load(pathJoin("hpc-ips", "18.0.1.163"))
load(pathJoin("hpc-impi", "18.0.1"))

load(pathJoin("cmake", "3.20.0"))
load(pathJoin("cmake", "3.20.2"))

load(pathJoin("jasper", "2.0.25"))
load(pathJoin("zlib", "1.2.11"))
Expand Down
22 changes: 19 additions & 3 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ function _usage() {
}

_build_ufs_opt=""
_ops_opt=""
_verbose_opt=""
# Reset option counter in case this script is sourced
OPTIND=1
while getopts ":a:c:hv" option; do
while getopts ":a:c:hov" option; do
case "${option}" in
a) _build_ufs_opt+="-a ${OPTARG} ";;
c) _partial_opt+="-c ${OPTARG} ";;
h) _usage;;
o) _ops_opt+="-o";;
# s) _build_ufs_opt+="-s ${OPTARG} ";;
v) _verbose_opt="-v";;
\?)
Expand Down Expand Up @@ -123,7 +125,7 @@ $Build_ufs_model && {
#------------------------------------
$Build_gsi && {
echo " .... Building gsi .... "
./build_gsi.sh $_verbose_opt > $logs_dir/build_gsi.log 2>&1
./build_gsi.sh $_ops_opt $_verbose_opt > $logs_dir/build_gsi.log 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in building gsi."
Expand All @@ -132,12 +134,26 @@ $Build_gsi && {
((err+=$rc))
}

#------------------------------------
# build gsi monitor
#------------------------------------
$Build_gsi_monitor && {
echo " .... Building gsi monitor .... "
./build_gsi_monitor.sh $_ops_opt $_verbose_opt > $logs_dir/build_gsi_monitor.log 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in building gsi monitor."
echo "The log file is in $logs_dir/build_gsi_monitor.log"
fi
((err+=$rc))
}

#------------------------------------
# build UPP
#------------------------------------
$Build_upp && {
echo " .... Building UPP .... "
./build_upp.sh $_verbose_opt > $logs_dir/build_upp.log 2>&1
./build_upp.sh $_ops_opt $_verbose_opt > $logs_dir/build_upp.log 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in building UPP."
Expand Down
24 changes: 20 additions & 4 deletions sorc/build_gsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@ set -eux
source ./machine-setup.sh > /dev/null 2>&1
cwd=$(pwd)

gsitarget=$target
[[ "$target" == wcoss_cray ]] && gsitarget=cray
OPTIND=1
while getopts ":dov" option; do
case "${option}" in
d) export BUILD_TYPE="DEBUG";;
o) _ops="YES";;
v) export BUILD_VERBOSE="YES";;
\?)
echo "[$BASH_SOURCE]: Unrecognized option: ${option}"
usage
;;
:)
echo "[$BASH_SOURCE]: ${option} requires an argument"
usage
;;
esac
done
shift $((OPTIND-1))

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

cd gsi.fd/ush/
./build_all_cmake.sh "PRODUCTION" "$cwd/gsi.fd"
##./build_all_cmake.sh "PRODUCTION" "$cwd/gsi.fd" "NCO" # use this line for pruned NCO install
export GSI_MODE="GFS"
export REGRESSION_TESTS="NO"
./build.sh "$cwd/gsi.fd"

exit

80 changes: 80 additions & 0 deletions sorc/build_gsi_monitor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#! /usr/bin/env bash
set -eux

source ./machine-setup.sh > /dev/null 2>&1
cwd=$(pwd)

BUILD_TYPE="Release"
DIR_ROOT="${cwd}/gsi_monitor.fd"
BUILD_DIR="${DIR_ROOT}/build"
INSTALL_PREFIX="${DIR_ROOT}/install"
GSI_INSTALL_PREFIX="${cwd}/gsi.fd/install"

OPTIND=1
while getopts ":dov" option; do
case "${option}" in
d) export BUILD_TYPE="DEBUG";;
o) _ops="YES";;
v) export BUILD_VERBOSE="YES";;
\?)
echo "[$BASH_SOURCE]: Unrecognized option: ${option}"
usage
;;
:)
echo "[$BASH_SOURCE]: ${option} requires an argument"
usage
;;
esac
done
shift $((OPTIND-1))

# Load necessary modules
source machine-setup.sh > /dev/null 2>&1
module use ${cwd}/../modulefiles
modulefile=${cwd}/../modulefiles/gsi_monitor.${target}
if [[ -f ${modulefile}.lua ]]; then
set +x
module load gsi_monitor.$target
module list
set -x
else
echo "FATAL: modulefile ${modulefile}.lua not found!"
exit 1
fi

if [[ -d "${BUILD_DIR}" ]]; then
rm -Rf "${BUILD_DIR}"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"

CMAKE_OPTS=""

CMAKE_OPTS+="-DBUILD_UTIL_ALLMON=YES"

if [[ -d "${GSI_INSTALL_PREFIX}" ]]; then
CMAKE_OPTS+=" -Dncdiag_ROOT=${GSI_INSTALL_PREFIX}"
else
echo <<- EOF
FATAL: ${GSI_INSTALL_PREFIX} does not exist
Have you built GSI yet?
EOF
exit 2
fi

# Collect BUILD Options
CMAKE_OPTS+=" -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"

# Install destination for built executables, libraries, CMake Package config
CMAKE_OPTS+=" -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}"

set -x
cmake $CMAKE_OPTS $DIR_ROOT
make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-}
make install
set +x

# Clean up build directory
rm -Rf "${BUILD_DIR}"

exit
21 changes: 20 additions & 1 deletion sorc/build_upp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,29 @@ set -eux
source ./machine-setup.sh > /dev/null 2>&1
cwd=$(pwd)

OPTIND=1
_opts=""
while getopts ":dov" option; do
case "${option}" in
d) export BUILD_TYPE="DEBUG";;
o) _opts+="-g ";;
v) _opts+="-v ";;
\?)
echo "[$BASH_SOURCE]: Unrecognized option: ${option}"
usage
;;
:)
echo "[$BASH_SOURCE]: ${option} requires an argument"
usage
;;
esac
done
shift $((OPTIND-1))

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

cd ufs_model.fd/FV3/upp/tests
./compile_upp.sh
./compile_upp.sh ${_opts}
12 changes: 7 additions & 5 deletions sorc/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ function checkout() {
echo
return "${status}"
fi
cd "${dir}"
else
# Fetch any updates from server
cd "${dir}"
echo "|-- Fetching updates from ${remote}"
git fetch
fi
cd "${dir}"
echo "|-- Checking out ${version}"
git checkout "${version}" >> "${logfile}" 2>&1
status=$?
Expand Down Expand Up @@ -131,13 +132,14 @@ mkdir -p ${logdir}
# The checkout version should always be a speciifc commit (hash or tag), not a branch
errs=0
checkout "ufs_model.fd" "https://github.com/ufs-community/ufs-weather-model" "${ufs_model_hash:-Prototype-P8c}"; errs=$((errs + $?))
checkout "gsi.fd" "https://github.com/NOAA-EMC/GSI.git" "a62dec6" ; errs=$((errs + $?))
checkout "gldas.fd" "https://github.com/NOAA-EMC/GLDAS.git" "gldas_gfsv16_release.v.1.28.0" ; errs=$((errs + $?))
checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git" "04ad17e" ; errs=$((errs + $?))
checkout "gsi.fd" "https://github.com/NOAA-EMC/GSI.git" "ad84f17" ; errs=$((errs + $?))
checkout "gsi_monitor.fd" "https://github.com/NOAA-EMC/GSI-Monitor.git" "affeae9" ; errs=$((errs + $?))
checkout "gldas.fd" "https://github.com/NOAA-EMC/GLDAS.git" "fd8ba62" ; errs=$((errs + $?))
checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git" "a2b0817" ; errs=$((errs + $?))
checkout "verif-global.fd" "https://github.com/NOAA-EMC/EMC_verif-global.git" "c267780" ; errs=$((errs + $?))

if [[ "${checkout_wafs:-NO}" == "YES" ]]; then
checkout "gfs_wafs.fd" "https://github.com/NOAA-EMC/EMC_gfs_wafs.git" "c2a29a6"; errs=$((errs + $?))
checkout "gfs_wafs.fd" "https://github.com/NOAA-EMC/EMC_gfs_wafs.git" "014a0b8"; errs=$((errs + $?))
fi

if [[ "${checkout_gtg:-NO}" == "YES" ]]; then
Expand Down
1 change: 1 addition & 0 deletions sorc/gfs_build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Building ufs_model (ufs_model) ........................ yes
Building ww3_prepost (ww3_prepost) .................... yes
Building gsi (gsi) .................................... yes
Building gsi_monitor (gsi_monitor) .................... yes
Building gldas (gldas) ................................ yes
Building UPP (upp) .................................... yes
Building ufs_utils (ufs_utils) ........................ yes
Expand Down
Loading

0 comments on commit 65cdcce

Please sign in to comment.