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

Call ccpp_prebuild.py from cmake, CCPP suites argument optional, update regional tests, ... #126

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
29d18dc
Move ccpp_prebuild from build scripts to CMakeLists.txt
DusanJovic-NOAA Apr 27, 2020
fb9725b
Merge remote-tracking branch 'origin/develop' into cmake_ccpp_prebuild
DusanJovic-NOAA May 8, 2020
b88805b
Add find_package(Python) to CMakeLists.txt
DusanJovic-NOAA May 11, 2020
efd215e
Merge branch 'cmake_ccpp_prebuild' of https://github.com/DusanJovic-N…
climbfuji May 11, 2020
5847c00
Update .gitmodules and submodule pointers for fv3atm, NEMS, stochasti…
climbfuji May 11, 2020
8d37f8f
modulefiles/orion.intel/fv3: use Python 3 on orion
climbfuji May 11, 2020
db7aeeb
Update to compile scripts and top-level CMakeLists.txt for not specif…
climbfuji May 11, 2020
5bb3731
Update of regional tests to reflect changes in suite definition files
climbfuji May 11, 2020
b551a04
Update submodule pointer for fv3atm
climbfuji May 11, 2020
9510e61
Use cmake 3.16.1 on hera
climbfuji May 12, 2020
674f3e9
Require cmake 3.15 or later in top-level CMakeLists.txt
climbfuji May 12, 2020
e0d93e8
Bugfix in tests/fv3_conf/ccpp_regional_run.IN
climbfuji May 12, 2020
1e0d827
Update submodule pointer for fv3atm
climbfuji May 12, 2020
ad7beeb
Python 3 compatibility for tests/abort_dep_tasks.py
climbfuji May 12, 2020
3b9af54
Revert loading of Python 3 for orion.intel
climbfuji May 12, 2020
ef39e91
Update date tag of regression test baseline in tests/rt.sh
climbfuji May 12, 2020
961facd
Regression test logs for all platforms using rt.sh
climbfuji May 12, 2020
f429b82
Revert change to .gitmodules and update submodule pointers for fv3atm…
climbfuji May 13, 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
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
[submodule "stochastic_physics"]
path = stochastic_physics
url = https://github.com/noaa-psd/stochastic_physics

54 changes: 53 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

foreach(env_var IN ITEMS
CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_Fortran_COMPILER
Expand Down Expand Up @@ -36,6 +36,58 @@ add_definitions(-DUSE_COND)
add_definitions(-DNEW_TAUCTMAX)
add_definitions(-DINTERNAL_FILE_NML)

if(CCPP)

find_package(Python 3 QUIET COMPONENTS Interpreter)
if (NOT Python_Interpreter_FOUND)
find_package(Python 2.7 QUIET REQUIRED COMPONENTS Interpreter)
endif()
message("Found Python: ${Python_EXECUTABLE}")

if(DEFINED CCPP_SUITES)
message("Calling CCPP code generator (ccpp_prebuild.py) for SUITES = ${CCPP_SUITES}")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--suites=${CCPP_SUITES}"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err
RESULT_VARIABLE RC
)
else()
message("Calling CCPP code generator (ccpp_prebuild.py) ...")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err
RESULT_VARIABLE RC
)
endif()

# Check return code from ccpp_prebuild.py
if(RC EQUAL 0)
message("")
else()
message(FATAL_ERROR "An error occured while running ccpp_prebuild.py, check ${PROJECT_BINARY_DIR}/ccpp_prebuild.{out,err}")
endif()

# this should not be necessary; including CCPP_*.cmake here and passing
# SCHEMES, CAPS and TYPEDEFS via environment variables to CCPP build.
# CCPP should be able to directly include those three .cmake files.

include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_SCHEMES.cmake)
include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_CAPS.cmake)
include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_TYPEDEFS.cmake)

set(ENV{CCPP_SCHEMES} "${SCHEMES}")
set(ENV{CCPP_CAPS} "${CAPS}")
set(ENV{CCPP_TYPEDEFS} "${TYPEDEFS}")

endif()

###############################################################################
### FMS
###############################################################################
Expand Down
10 changes: 0 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}

CCPP_SUITES="${CCPP_SUITES:-FV3_GFS_2017_gfdlmp}"

./FV3/ccpp/framework/scripts/ccpp_prebuild.py \
--config=FV3/ccpp/config/ccpp_prebuild_config.py \
--suites=${CCPP_SUITES} \
--builddir=${BUILD_DIR}/FV3 > ${BUILD_DIR}/ccpp_prebuild.log 2>&1

source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_SCHEMES.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_CAPS.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_STATIC_API.sh

CMAKE_FLAGS+=" -DCCPP=ON -DSUITES=${CCPP_SUITES} -DNETCDF_DIR=${NETCDF}"

cd ${BUILD_DIR}
Expand Down
3 changes: 1 addition & 2 deletions modulefiles/hera.gnu/fv3
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ module load NCEPlibs/1.0.0
##
## load cmake
##
module use -a /scratch1/BMC/gmtb/software/modulefiles/generic
module load cmake/3.16.3
module load cmake/3.16.1
setenv CMAKE_C_COMPILER mpicc
setenv CMAKE_CXX_COMPILER mpicxx
setenv CMAKE_Fortran_COMPILER mpif90
Expand Down
3 changes: 1 addition & 2 deletions modulefiles/hera.intel/fv3
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ module load esmf/8.0.0_ParallelNetCDF
##
## load cmake
##
module use /contrib/modulefiles
module load cmake/3.9.0
module load cmake/3.16.1
setenv CMAKE_C_COMPILER mpiicc
setenv CMAKE_CXX_COMPILER mpiicpc
setenv CMAKE_Fortran_COMPILER mpiifort
Expand Down
4 changes: 4 additions & 0 deletions modulefiles/orion.intel/fv3
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ module load netcdfp/4.7.4
module load esmflocal/8.0.0.para
module load post-intel-sandybridge/8.0.5

###
### load Python 3
#module load python/3.7.5

##
## load cmake
##
Expand Down
8 changes: 4 additions & 4 deletions modulefiles/wcoss_dell_p3/fv3
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ module-whatis "loads NEMS FV3 prerequisites on Venus and Mars"
module load ips/18.0.1.163
module load impi/18.0.1
module load lsf/10.1
module load cmake/3.10.0
module load lsf/10.1
junwang-noaa marked this conversation as resolved.
Show resolved Hide resolved
module load cmake/3.16.2
# module load python/3.6.3
module load python/2.7.14

module use -a /usrx/local/nceplibs/dev/NCEPLIBS/modulefiles

Expand All @@ -44,13 +45,12 @@ module load post/8.0.6

module use /gpfs/dell2/emc/modeling/noscrub/emc.nemspara/soft/modulefiles
module load hdf5_parallel/1.10.6
module load netcdf_parallel/4.7.4
module load netcdf_parallel/4.7.4
module load esmf/8.0.0_ParallelNetCDF

##
## load cmake
##
module load cmake/3.10.0
setenv CMAKE_C_COMPILER mpiicc
setenv CMAKE_CXX_COMPILER mpiicpc
setenv CMAKE_Fortran_COMPILER mpiifort
Expand Down
2 changes: 2 additions & 0 deletions parm/ccpp_regional.nml.IN
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
hord_tr = -8
adjust_dry_mass = .F.
consv_te = 0.
do_sat_adj = .T.
consv_am = .F.
fill = .T.
dwind_2d = .F.
Expand Down Expand Up @@ -177,6 +178,7 @@
debug = .false.
oz_phys = @[OZ_PHYS_OLD]
oz_phys_2015 = @[OZ_PHYS_NEW]
h2o_phys = @[H2O_PHYS]
nstf_name = 1,1,1,0,5
cplflx = .F.
iau_delthrs = 6
Expand Down
2 changes: 2 additions & 0 deletions parm/ccpp_regional_c768.nml.IN
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
hord_tr = 8
adjust_dry_mass = .F.
consv_te = 0.
do_sat_adj = .T.
consv_am = .F.
fill = .T.
dwind_2d = .F.
Expand Down Expand Up @@ -174,6 +175,7 @@
debug = .false.
oz_phys = @[OZ_PHYS_OLD]
oz_phys_2015 = @[OZ_PHYS_NEW]
h2o_phys = @[H2O_PHYS]
nstf_name = 1,1,1,0,5
cplflx = .F.
iau_delthrs = 6
Expand Down
2 changes: 1 addition & 1 deletion stochastic_physics
Loading