Skip to content

Commit

Permalink
Preparation for S2S cmake (NOAA-EMC#213)
Browse files Browse the repository at this point in the history
- All `#ifdef OPENMP` are replaced with `#ifdef _OPENMP` to follow standard compiler macro for OpenMP.
- CCPP code generation is moved inside of `FV3/`.  This will be redundant when the Data Atmosphere component comes in. Updates to the python script was performed to remove the hard-wired `FV3/` path name in the file.
- `cmake/GNU.cmake` and `cmake/Intel.cmake` hard-wire global compiler definitions with `add_definitions`.  These are now applied with `target_compile_definitions`. 
- CMakeLists.txt is passed through cmake-norm checker.
- `INSTALL_INTERFACE` is added, so that this component can be installed and linked in downstream applications e.g. JEDI. 
This may be incomplete, so will need more work.
  • Loading branch information
aerorahul committed Oct 7, 2020
1 parent f3db58e commit 2190530
Show file tree
Hide file tree
Showing 14 changed files with 374 additions and 445 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
coupled*.mk
rt.conf.single
*.swp
*~

build*/
install*/

ufs_weather_model
NEMS.exe
*.exe

tests/fv3_*.exe
tests/modules.fv3_*
tests/ecflow_run/
tests/log_*/
tests/lock/
tests/Compile_*.log
30 changes: 15 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[submodule "FV3"]
path = FV3
url = https://github.com/NOAA-EMC/fv3atm
branch = develop
path = FV3
url = https://github.com/NOAA-EMC/fv3atm
branch = develop
[submodule "NEMS"]
path = NEMS
url = https://github.com/NOAA-EMC/NEMS
branch = develop
path = NEMS
url = https://github.com/NOAA-EMC/NEMS
branch = develop
[submodule "FMS"]
path = FMS
url = https://github.com/NOAA-GFDL/FMS
branch = master
path = FMS
url = https://github.com/NOAA-GFDL/FMS
branch = master
[submodule "WW3"]
path = WW3
url = https://github.com/NOAA-EMC/WW3
branch = develop
path = WW3
url = https://github.com/NOAA-EMC/WW3
branch = develop
[submodule "stochastic_physics"]
path = stochastic_physics
url = https://github.com/noaa-psd/stochastic_physics
branch = master
path = stochastic_physics
url = https://github.com/noaa-psd/stochastic_physics
branch = master
259 changes: 110 additions & 149 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ CMAKE_FLAGS+=" -DNETCDF_DIR=${NETCDF}"

cd ${BUILD_DIR}
cmake ${UFS_MODEL_DIR} ${CMAKE_FLAGS}
make -j ${BUILD_JOBS:-4}
make -j ${BUILD_JOBS:-4} VERBOSE=${BUILD_VERBOSE:-0}
33 changes: 1 addition & 32 deletions cmake/GNU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,6 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()


if(32BIT)
add_definitions(-DOVERLOAD_R4)
add_definitions(-DOVERLOAD_R8)
else()
if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8")
endif()


if(OPENMP)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fopenmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
add_definitions(-DOPENMP)
endif()

if(AVX2)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
elseif(SIMDMULTIARCH)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()

if(QUAD_PRECISION)
add_definitions(-DENABLE_QUAD_PRECISION)
endif()

if(MULTI_GASES)
add_definitions(-DMULTI_GASES)
endif()
18 changes: 0 additions & 18 deletions cmake/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -sox -align array64byte")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qno-opt-dynamic-align")


if(32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i4 -real-size 32")
add_definitions(-DOVERLOAD_R4)
add_definitions(-DOVERLOAD_R8)
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i4 -real-size 64")
if(NOT REPRO)
Expand Down Expand Up @@ -54,19 +51,4 @@ else()
set(FAST "-fast-transcendentals")
endif()

if(OPENMP)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qopenmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopenmp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qopenmp")
add_definitions(-DOPENMP)
endif()

if(QUAD_PRECISION)
add_definitions(-DENABLE_QUAD_PRECISION)
endif()

if(MULTI_GASES)
add_definitions(-DMULTI_GASES)
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__IFC -sox -fp-model source")
2 changes: 1 addition & 1 deletion stochastic_physics
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 @@
Thu Oct 1 13:48:21 UTC 2020
Mon Oct 5 19:57:38 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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfdlmp_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v15p2_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_flake_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gsd_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_thompson_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_thompson_no_aero_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_rrfs_v1beta_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_control_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v15p2_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_gfs_v16beta_debug_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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/Dusan.Jovic/FV3_RT/rt_124202/fv3_ccpp_multigases_prod
working dir = /scratch1/NCEPDEV/stmp2/Rahul.Mahajan/FV3_RT/rt_292576/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
Thu Oct 1 14:10:17 UTC 2020
Elapsed time: 00h:21m:57s. Have a nice day!
Mon Oct 5 20:22:39 UTC 2020
Elapsed time: 00h:25m:02s. Have a nice day!
Loading

0 comments on commit 2190530

Please sign in to comment.