Skip to content
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

RRTMG cloud overlap method update #184

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7ec01a2
Update .gitmodules and submodule pointer for fv3atm for code review a…
climbfuji Aug 11, 2020
7922f8f
Use compile_cmake.sh in all rt.sh tests
DusanJovic-NOAA Sep 22, 2020
0f59f9b
Remove APPBUILD option from rt.sh
DusanJovic-NOAA Sep 22, 2020
de708fe
Rename NEMS_VER to MAKE_OPT in rt.sh, rt_utils.sh and utest
DusanJovic-NOAA Sep 22, 2020
e0f9461
Rename compile_cmake.sh to compile.sh
DusanJovic-NOAA Sep 22, 2020
b80eac5
Merge branch 'develop' of https://github.com/ufs-community/ufs-weathe…
climbfuji Sep 22, 2020
a5154e6
tests/compile_cmake.sh: create directory FMS/fms2_io/include so that …
climbfuji Sep 22, 2020
efd842e
Merge branch 'update_compile_script' of https://github.com/dusanjovic…
climbfuji Sep 22, 2020
9d763b0
Fix readlink command for macOS, similar to what was done in branch re…
climbfuji Sep 23, 2020
91e4261
Use NEMS_COMPILER throughout instead of a mixture of COMPILER and NEM…
climbfuji Sep 23, 2020
e62408b
Regression test logs for hera.gnu, hera.intel, orion.intel, cheyenne.…
climbfuji Sep 23, 2020
b5e1ac7
Replace GSL drag suite with CIRES UGWP/GFS GWD in tests/tests/fv3_ccp…
climbfuji Sep 23, 2020
bd98455
Remove PGI from default_vars.sh
climbfuji Sep 23, 2020
1d912f7
Remove lines 'cp /../FV3/ccpp/suites/suite_.xml suite_.xml' from test…
climbfuji Sep 23, 2020
fbdb1cc
Change regression test baseline date tag from 20200918 to 20200923
climbfuji Sep 23, 2020
d5f538d
Rename NEMS_COMPILER and NEMS_MACHINE to RT_COMPILER and RT_MACHINE i…
climbfuji Sep 23, 2020
10bdc59
Bugfix in tests/rt.sh: need to export RT_COMPILER for compile jobs; s…
climbfuji Sep 23, 2020
aa6f104
Regression test logs for hera.gnu, hera.intel, orion.intel, cheyenne.…
climbfuji Sep 24, 2020
fc6dce9
Regression test log for cheyenne.intel; skip-ci
climbfuji Sep 24, 2020
2a51542
Regression test log for wcoss_dell_p3; skip-ci
climbfuji Sep 25, 2020
84a036c
Fix problems with running compile job on wcoss_cray
climbfuji Sep 25, 2020
220c182
Regression test log for wcoss_cray; skip-ci
climbfuji Sep 25, 2020
719703e
Revert change to .gitmodules and update submodule pointer for fv3atm
climbfuji Sep 28, 2020
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
6 changes: 4 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[submodule "FV3"]
path = FV3
url = https://github.com/NOAA-EMC/fv3atm
branch = develop
#url = https://github.com/NOAA-EMC/fv3atm
#branch = develop
url = https://github.com/climbfuji/fv3atm
branch = iacono_cloud_overlap_merged_with_rrtmgp_and_updated
[submodule "NEMS"]
path = NEMS
url = https://github.com/NOAA-EMC/NEMS
Expand Down
2 changes: 1 addition & 1 deletion FV3
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
set -eu

MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
if [[ $(uname -s) == Darwin ]]; then
readonly MYDIR=$(cd "$(dirname "$(greadlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
else
readonly MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
fi

export CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-mpicc}
export CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER:-mpicxx}
Expand Down
193 changes: 119 additions & 74 deletions tests/compile.sh
Original file line number Diff line number Diff line change
@@ -1,115 +1,160 @@
#!/bin/bash
set -eux

function trim {
local var="$1"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
echo -n "$var"
}

SECONDS=0

if [[ $# -lt 2 ]]; then
echo "Usage: $0 PATHTR BUILD_TARGET [ MAKE_OPT [ BUILD_NR ] [ clean_before ] [ clean_after ] ]"
echo Valid BUILD_TARGETs:
echo $( ls -1 ../conf/configure.fv3.* | sed s,.*fv3\.,,g ) | fold -sw72
exit 1
if [[ $(uname -s) == Darwin ]]; then
readonly MYDIR=$(cd "$(dirname "$(greadlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
else
readonly MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
fi

# ----------------------------------------------------------------------
# Parse arguments.

readonly PATHTR=$1
readonly BUILD_TARGET=$2
MAKE_OPT=${3:-}
readonly BUILD_NAME=fv3${4:+_$4}
readonly ARGC=$#

readonly clean_before=${5:-YES}
readonly clean_after=${6:-YES}
if [[ $ARGC -lt 2 ]]; then
echo "Usage: $0 MACHINE_ID [ MAKE_OPT [ BUILD_NR ] [ clean_before ] [ clean_after ] ]"
echo Valid MACHINE_IDs:
echo $( ls -1 ../cmake/configure_* | sed s:.*configure_::g | sed s:\.cmake:: ) | fold -sw72
exit 1
else
MACHINE_ID=$1
MAKE_OPT=${2:-}
BUILD_NAME=fv3${3:+_$3}
clean_before=${4:-YES}
clean_after=${5:-YES}
fi

hostname
PATHTR=$( cd ${MYDIR}/.. && pwd )
BUILD_DIR=$(pwd)/build_${BUILD_NAME}

# ----------------------------------------------------------------------
# Make sure we have reasonable number of threads.

echo "Compiling ${MAKE_OPT} into $BUILD_NAME.exe on $BUILD_TARGET"

# ----------------------------------------------------------------------
# Make sure we have a "make" and reasonable threads.

gnu_make=gmake
if ( ! which $gnu_make ) ; then
echo WARNING: Cannot find gmake in \$PATH. I will use \"make\" instead.
gnu_make=make
if ( ! $gnu_make --version 2>&1 | grep -i gnu > /dev/null 2>&1 ) ; then
echo WARNING: The build system requires GNU Make. Things may break.
fi
fi

if [[ $BUILD_TARGET == cheyenne.* || $BUILD_TARGET == stampede.* ]] ; then
if [[ $MACHINE_ID == cheyenne.* ]] ; then
MAKE_THREADS=${MAKE_THREADS:-3}
elif [[ $MACHINE_ID == wcoss_dell_p3 ]] ; then
MAKE_THREADS=${MAKE_THREADS:-1}
fi

MAKE_THREADS=${MAKE_THREADS:-8}

if [[ "$MAKE_THREADS" -gt 1 ]] ; then
echo Using \$MAKE_THREADS=$MAKE_THREADS threads to build FV3 and FMS.
echo Consider reducing \$MAKE_THREADS if you hit memory or process limits.
gnu_make="$gnu_make -j $MAKE_THREADS"
fi
hostname

# ----------------------------------------------------------------------
# Configure NEMS and components
set +x
source $PATHTR/NEMS/src/conf/module-setup.sh.inc
if [[ $MACHINE_ID == macosx.* ]] || [[ $MACHINE_ID == linux.* ]]; then
source $PATHTR/modulefiles/${MACHINE_ID}/fv3
else
module use $PATHTR/modulefiles/${MACHINE_ID}
module load fv3
module list
fi
set -x

# Configure NEMS
cd "$PATHTR/../NEMS"
echo "Compiling ${MAKE_OPT} into $BUILD_NAME.exe on $MACHINE_ID"

COMPONENTS="FMS,FV3"
if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
COMPONENTS="CCPP,$COMPONENTS"
if [ $clean_before = YES ] ; then
rm -rf ${BUILD_DIR}
fi

if [[ "${MAKE_OPT}" == *"WW3=Y"* ]]; then
COMPONENTS="WW3,$COMPONENTS"
fi
mkdir -p ${BUILD_DIR}

# Make variables:
# COMPONENTS = list of components to build
# BUILD_ENV = theia.intel, wcoss_dell_p3, etc.
# FV3_MAKEOPT = build options to send to FV3, CCPP, and FMS
# TEST_BUILD_NAME = requests copying of modules.nems and
# NEMS.x into the tests/ directory using the given build name.
# set CCPP_CMAKE_FLAGS based on $MAKE_OPT

# FIXME: add -j $MAKE_THREADS once FV3 bug is fixed
CCPP_CMAKE_FLAGS="-DNETCDF_DIR=${NETCDF}"

# Pass DEBUG or REPRO flags to NEMS
if [[ "${MAKE_OPT}" == *"DEBUG=Y"* && "${MAKE_OPT}" == *"REPRO=Y"* ]]; then
echo "ERROR in compile.sh: options DEBUG=Y and REPRO=Y are mutually exclusive"
exit 1
elif [[ "${MAKE_OPT}" == *"DEBUG=Y"* ]]; then
NEMS_BUILDOPT="DEBUG=Y"
if [[ "${MAKE_OPT}" == *"DEBUG=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DDEBUG=Y"
elif [[ "${MAKE_OPT}" == *"REPRO=Y"* ]]; then
NEMS_BUILDOPT="REPRO=Y"
else
NEMS_BUILDOPT=""
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DREPRO=Y"
fi

if [ $clean_before = YES ] ; then
$gnu_make -k COMPONENTS="$COMPONENTS" TEST_BUILD_NAME="$BUILD_NAME" \
BUILD_ENV="$BUILD_TARGET" FV3_MAKEOPT="$MAKE_OPT" \
NEMS_BUILDOPT="$NEMS_BUILDOPT" distclean
if [[ "${MAKE_OPT}" == *"32BIT=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -D32BIT=Y"
fi

if [[ "${MAKE_OPT}" == *"OPENMP=N"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DOPENMP=OFF"
fi

if [[ "${MAKE_OPT}" == *"MULTI_GASES=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=ON"
else
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=OFF"
fi

# FIXME - create CCPP include directory before building FMS to avoid
# gfortran warnings of non-existent include directory (adding
# -Wno-missing-include-dirs) to the GNU compiler flags does not work,
# see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534);
# this line can be removed once FMS becomes a pre-installed library
if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
mkdir -p $PATHTR/ccpp/include

# FIXME - create CCPP include directory before building FMS to avoid
# gfortran warnings of non-existent include directory (adding
# -Wno-missing-include-dirs) to the GNU compiler flags does not work,
# see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534);
# this line can be removed once FMS becomes a pre-installed library
mkdir -p $PATHTR/FV3/ccpp/include
# Similar for this directory, which apparently never gets populated
mkdir -p $PATHTR/FMS/fms2_io/include

CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DCCPP=ON -DMPI=ON"

if [[ "${MAKE_OPT}" == *"DEBUG=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Debug"
elif [[ "${MAKE_OPT}" == *"REPRO=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Bitforbit"
else
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Release"
if [[ "${MACHINE_ID}" == "jet.intel" ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DSIMDMULTIARCH=ON"
fi
fi

if [[ "${MAKE_OPT}" == *"32BIT=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DDYN32=ON"
else
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DDYN32=OFF"
fi

# Check if suites argument is provided or not
set +ex
TEST=$( echo $MAKE_OPT | grep -e "SUITES=" )
if [[ $? -eq 0 ]]; then
SUITES=$( echo $MAKE_OPT | sed 's/.* SUITES=//' | sed 's/ .*//' )
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DCCPP_SUITES=${SUITES}"
echo "Compiling suites ${SUITES}"
fi
set -ex

fi

$gnu_make -k COMPONENTS="$COMPONENTS" TEST_BUILD_NAME="$BUILD_NAME" \
BUILD_ENV="$BUILD_TARGET" FV3_MAKEOPT="$MAKE_OPT" \
NEMS_BUILDOPT="$NEMS_BUILDOPT" build
if [[ "${MAKE_OPT}" == *"WW3=Y"* ]]; then
CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DWW3=Y"
fi

CCPP_CMAKE_FLAGS=$(trim "${CCPP_CMAKE_FLAGS}")

(
cd ${BUILD_DIR}

cmake ${PATHTR} ${CCPP_CMAKE_FLAGS}
make -j ${MAKE_THREADS}
mv NEMS.exe ${PATHTR}/tests/${BUILD_NAME}.exe
cp ${PATHTR}/modulefiles/${MACHINE_ID}/fv3 ${PATHTR}/tests/modules.${BUILD_NAME}
cd ..
)

if [ $clean_after = YES ] ; then
$gnu_make -k COMPONENTS="$COMPONENTS" TEST_BUILD_NAME="$BUILD_NAME" \
BUILD_ENV="$BUILD_TARGET" FV3_MAKEOPT="$MAKE_OPT" \
NEMS_BUILDOPT="$NEMS_BUILDOPT" clean
rm -rf ${BUILD_DIR}
fi

elapsed=$SECONDS
Expand Down
Loading