Skip to content

Commit

Permalink
Use top-level build.sh in regression test compile scripts (#209)
Browse files Browse the repository at this point in the history
* Use top-level build.sh to compile executables in for regression tests
* Do not copy the executable from build to the top-level directory
  • Loading branch information
DusanJovic-NOAA authored Oct 2, 2020
1 parent 208f36d commit f3db58e
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 284 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,23 +262,23 @@ target_link_libraries(ufs-weather-model-lib PUBLIC fv3atm)
###############################################################################
### UFS executable
###############################################################################
add_executable(NEMS.exe
add_executable(ufs_model
NEMS/src/MAIN_NEMS.F90
)
add_dependencies(NEMS.exe ufs-weather-model-lib)
add_dependencies(ufs_model ufs-weather-model-lib)

target_compile_definitions(NEMS.exe PRIVATE -DESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR})
target_include_directories(NEMS.exe PRIVATE ${PROJECT_BINARY_DIR}/NEMS/src)
target_compile_definitions(ufs_model PRIVATE -DESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR})
target_include_directories(ufs_model PRIVATE ${PROJECT_BINARY_DIR}/NEMS/src)

set_target_properties(NEMS.exe PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/mod)
set_target_properties(ufs_model PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/mod)

if(WW3)
target_compile_definitions(NEMS.exe PRIVATE -DFRONT_WW3=WMESMFMD)
set_target_properties(NEMS.exe PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/WW3/model/mod)
add_dependencies(NEMS.exe ww3_nems)
target_compile_definitions(ufs_model PRIVATE -DFRONT_WW3=WMESMFMD)
set_target_properties(ufs_model PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/WW3/model/mod)
add_dependencies(ufs_model ww3_nems)
endif()

target_link_libraries(NEMS.exe
target_link_libraries(ufs_model
ufs-weather-model-lib
${WW3_LIBS}
esmf NetCDF::NetCDF_Fortran ${MKL_LIB})
Expand Down
16 changes: 7 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
set -eu

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

export CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-mpicc}
Expand All @@ -14,14 +14,12 @@ export CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER:-mpif90}
export NETCDF=${NETCDF:?"Please set NETCDF environment variable"}
export ESMFMKFILE=${ESMFMKFILE:?"Please set ESMFMKFILE environment variable"}

BUILD_DIR=${MYDIR}/build
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
BUILD_DIR=${BUILD_DIR:-${UFS_MODEL_DIR}/build}
mkdir -p ${BUILD_DIR}

CCPP_SUITES="${CCPP_SUITES:-FV3_GFS_v15p2}"
CMAKE_FLAGS+=" -DCCPP_SUITES=${CCPP_SUITES} -DNETCDF_DIR=${NETCDF}"
[[ -n "${CCPP_SUITES:-""}" ]] && CMAKE_FLAGS+=" -DCCPP_SUITES=${CCPP_SUITES}"
CMAKE_FLAGS+=" -DNETCDF_DIR=${NETCDF}"

cd ${BUILD_DIR}
cmake .. ${CMAKE_FLAGS}
cmake ${UFS_MODEL_DIR} ${CMAKE_FLAGS}
make -j ${BUILD_JOBS:-4}
cp NEMS.exe ${MYDIR}/ufs_weather_model
30 changes: 15 additions & 15 deletions tests/RegressionTests_hera.gnu.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Tue Sep 29 14:43:14 UTC 2020
Thu Oct 1 13:48:21 UTC 2020
Start Regression test


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfdlmp_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfdlmp_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfdlmp_prod
Checking test 001 fv3_ccpp_gfdlmp results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -51,7 +51,7 @@ Test 001 fv3_ccpp_gfdlmp PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfs_v15p2_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfs_v15p2_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v15p2_prod
Checking test 002 fv3_ccpp_gfs_v15p2 results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -119,7 +119,7 @@ Test 002 fv3_ccpp_gfs_v15p2 PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfs_v16beta_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfs_v16beta_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_prod
Checking test 003 fv3_ccpp_gfs_v16beta results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -187,7 +187,7 @@ Test 003 fv3_ccpp_gfs_v16beta PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfs_v16beta_flake_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfs_v16beta_flake_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_flake_prod
Checking test 004 fv3_ccpp_gfs_v16beta_flake results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -255,7 +255,7 @@ Test 004 fv3_ccpp_gfs_v16beta_flake PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gsd_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gsd_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gsd_prod
Checking test 005 fv3_ccpp_gsd results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -347,7 +347,7 @@ Test 005 fv3_ccpp_gsd PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_thompson_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_thompson_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_thompson_prod
Checking test 006 fv3_ccpp_thompson results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -415,7 +415,7 @@ Test 006 fv3_ccpp_thompson PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_thompson_no_aero_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_thompson_no_aero_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_thompson_no_aero_prod
Checking test 007 fv3_ccpp_thompson_no_aero results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -483,7 +483,7 @@ Test 007 fv3_ccpp_thompson_no_aero PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_rrfs_v1beta_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_rrfs_v1beta_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_rrfs_v1beta_prod
Checking test 008 fv3_ccpp_rrfs_v1beta results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -575,13 +575,13 @@ Test 008 fv3_ccpp_rrfs_v1beta PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_control_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_control_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_control_debug_prod
Checking test 009 fv3_ccpp_control_debug results ....
Test 009 fv3_ccpp_control_debug PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfs_v15p2_debug_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfs_v15p2_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v15p2_debug_prod
Checking test 010 fv3_ccpp_gfs_v15p2_debug results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -649,7 +649,7 @@ Test 010 fv3_ccpp_gfs_v15p2_debug PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_gfs_v16beta_debug_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_gfs_v16beta_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_debug_prod
Checking test 011 fv3_ccpp_gfs_v16beta_debug results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -717,7 +717,7 @@ Test 011 fv3_ccpp_gfs_v16beta_debug PASS


baseline dir = /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/develop-20200929/GNU/fv3_multigases_ccpp
working dir = /scratch1/NCEPDEV/stmp2/Dom.Heinzeller/FV3_RT/rt_179204/fv3_ccpp_multigases_prod
working dir = /scratch1/NCEPDEV/stmp2/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_multigases_prod
Checking test 012 fv3_ccpp_multigases results ....
Comparing atmos_4xdaily.tile1.nc .........OK
Comparing atmos_4xdaily.tile2.nc .........OK
Expand Down Expand Up @@ -791,5 +791,5 @@ Test 012 fv3_ccpp_multigases PASS


REGRESSION TEST WAS SUCCESSFUL
Tue Sep 29 15:07:20 UTC 2020
Elapsed time: 00h:24m:09s. Have a nice day!
Thu Oct 1 14:10:17 UTC 2020
Elapsed time: 00h:21m:57s. Have a nice day!
Loading

0 comments on commit f3db58e

Please sign in to comment.