Skip to content

Commit

Permalink
Merge pull request NOAA-EMC#80 from climbfuji/gsl_develop_chem_add_go…
Browse files Browse the repository at this point in the history
…cart

Update gsd/develop-chem from gsl/develop, replace #ifndef CCPP with #if 0
  • Loading branch information
DomHeinzeller authored Apr 13, 2021
2 parents ff6637d + 7c65d67 commit 0e197f9
Show file tree
Hide file tree
Showing 265 changed files with 9,701 additions and 238,347 deletions.
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "atmos_cubed_sphere"]
path = atmos_cubed_sphere
url = https://github.com/NOAA-GSL/GFDL_atmos_cubed_sphere
branch = gsd/develop
url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere
branch = dev/emc
[submodule "ccpp/framework"]
path = ccpp/framework
url = https://github.com/NOAA-GSL/ccpp-framework
branch = gsd/develop
branch = gsl/develop
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NOAA-GSL/ccpp-physics
branch = gsd/develop-chem
branch = gsl/develop-chem
264 changes: 159 additions & 105 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,94 +1,141 @@
if(CCPP)
add_definitions(-DCCPP)
# Call to CCPP code generator
if(DEBUG)
set(_ccpp_debug_arg "--debug")
endif()
if(DEFINED CCPP_SUITES)
set(_ccpp_suites_arg "--suites=${CCPP_SUITES}")
message("Calling CCPP code generator (ccpp_prebuild.py) for suites ${_ccpp_suites_arg} ...")
else()
message("Calling CCPP code generator (ccpp_prebuild.py) for all available suites ...")
endif()
execute_process(COMMAND ${Python_EXECUTABLE}
"ccpp/framework/scripts/ccpp_prebuild.py"
"--config=ccpp/config/ccpp_prebuild_config.py"
"--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.err
RESULT_VARIABLE RC)
# Check return code from ccpp_prebuild.py
if(NOT RC EQUAL 0)
message(FATAL_ERROR "An error occured while running ccpp_prebuild.py, check ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.{out,err}")
endif()

add_subdirectory(cpl)
add_subdirectory(gfsphysics)
add_subdirectory(ipd)
add_subdirectory(io)

###############################################################################
### fv3dycore
###############################################################################
if(NOT CCPP)
set(FAST_PHYSICS_SRCS_F90 atmos_cubed_sphere/model/fv_cmp.F90)
list(APPEND _fv3dycore_srcs
atmos_cubed_sphere/model/a2b_edge.F90
atmos_cubed_sphere/model/multi_gases.F90
atmos_cubed_sphere/model/boundary.F90
atmos_cubed_sphere/model/dyn_core.F90
atmos_cubed_sphere/model/fv_arrays.F90
atmos_cubed_sphere/model/fv_control.F90
atmos_cubed_sphere/model/fv_dynamics.F90
atmos_cubed_sphere/model/fv_fill.F90
atmos_cubed_sphere/model/fv_grid_utils.F90
atmos_cubed_sphere/model/fv_mapz.F90
atmos_cubed_sphere/model/fv_nesting.F90
atmos_cubed_sphere/model/fv_regional_bc.F90
atmos_cubed_sphere/model/fv_sg.F90
atmos_cubed_sphere/model/fv_tracer2d.F90
atmos_cubed_sphere/model/fv_update_phys.F90
atmos_cubed_sphere/model/sw_core.F90
atmos_cubed_sphere/model/tp_core.F90
atmos_cubed_sphere/model/nh_core.F90
atmos_cubed_sphere/model/nh_utils.F90
atmos_cubed_sphere/tools/coarse_grained_diagnostics.F90
atmos_cubed_sphere/tools/coarse_grained_restart_files.F90
atmos_cubed_sphere/tools/coarse_graining.F90
atmos_cubed_sphere/tools/external_ic.F90
atmos_cubed_sphere/tools/external_sst.F90
atmos_cubed_sphere/tools/fv_diag_column.F90
atmos_cubed_sphere/tools/fv_diagnostics.F90
atmos_cubed_sphere/tools/fv_eta.F90
atmos_cubed_sphere/tools/fv_grid_tools.F90
atmos_cubed_sphere/tools/fv_io.F90
atmos_cubed_sphere/tools/fv_mp_mod.F90
atmos_cubed_sphere/tools/fv_nudge.F90
atmos_cubed_sphere/tools/fv_treat_da_inc.F90
atmos_cubed_sphere/tools/fv_iau_mod.F90
atmos_cubed_sphere/tools/fv_restart.F90
atmos_cubed_sphere/tools/fv_surf_map.F90
atmos_cubed_sphere/tools/fv_timing.F90
atmos_cubed_sphere//tools/init_hydro.F90
atmos_cubed_sphere/tools/sim_nc_mod.F90
atmos_cubed_sphere/tools/sorted_index.F90
atmos_cubed_sphere/tools/test_cases.F90
atmos_cubed_sphere/driver/fvGFS/DYCORE_typedefs.F90
atmos_cubed_sphere/driver/fvGFS/fv_nggps_diag.F90
atmos_cubed_sphere/driver/fvGFS/atmosphere.F90)

add_library(fv3dycore ${_fv3dycore_srcs})

list(APPEND _fv3dycore_defs_private SPMD
use_WRTCOMP
GFS_PHYS
GFS_TYPES
USE_GFSL63
MOIST_CAPPA
USE_COND)

if(MULTI_GASES)
list(APPEND _fv3dycore_defs_private MULTI_GASES)
endif()

add_library(
fv3dycore

atmos_cubed_sphere/model/a2b_edge.F90
atmos_cubed_sphere/model/multi_gases.F90
atmos_cubed_sphere/model/boundary.F90
atmos_cubed_sphere/model/dyn_core.F90
atmos_cubed_sphere/model/fv_arrays.F90
${FAST_PHYSICS_SRCS_F90}
atmos_cubed_sphere/model/fv_control.F90
atmos_cubed_sphere/model/fv_dynamics.F90
atmos_cubed_sphere/model/fv_fill.F90
atmos_cubed_sphere/model/fv_grid_utils.F90
atmos_cubed_sphere/model/fv_mapz.F90
atmos_cubed_sphere/model/fv_nesting.F90
atmos_cubed_sphere/model/fv_regional_bc.F90
atmos_cubed_sphere/model/fv_sg.F90
atmos_cubed_sphere/model/fv_tracer2d.F90
atmos_cubed_sphere/model/fv_update_phys.F90
atmos_cubed_sphere/model/sw_core.F90
atmos_cubed_sphere/model/tp_core.F90
atmos_cubed_sphere/model/nh_core.F90
atmos_cubed_sphere/model/nh_utils.F90
atmos_cubed_sphere/tools/external_ic.F90
atmos_cubed_sphere/tools/external_sst.F90
atmos_cubed_sphere/tools/fv_diagnostics.F90
atmos_cubed_sphere/tools/fv_eta.F90
atmos_cubed_sphere/tools/fv_grid_tools.F90
atmos_cubed_sphere/tools/fv_io.F90
atmos_cubed_sphere/tools/fv_mp_mod.F90
atmos_cubed_sphere/tools/fv_nudge.F90
atmos_cubed_sphere/tools/fv_treat_da_inc.F90
atmos_cubed_sphere/tools/fv_iau_mod.F90
atmos_cubed_sphere/tools/fv_restart.F90
atmos_cubed_sphere/tools/fv_surf_map.F90
atmos_cubed_sphere/tools/fv_timing.F90
atmos_cubed_sphere//tools/init_hydro.F90
atmos_cubed_sphere/tools/sim_nc_mod.F90
atmos_cubed_sphere/tools/sorted_index.F90
atmos_cubed_sphere/tools/test_cases.F90
atmos_cubed_sphere/driver/fvGFS/DYCORE_typedefs.F90
atmos_cubed_sphere/driver/fvGFS/fv_nggps_diag.F90
atmos_cubed_sphere/driver/fvGFS/atmosphere.F90
)
if(32BIT)
set(DYN32 ON CACHE BOOL "Enable support for 32bit fast physics in CCPP")
list(APPEND _fv3dycore_defs_private OVERLOAD_R4
OVERLOAD_R8)
else()
set(DYN32 OFF CACHE BOOL "Disable support for 32bit fast physics in CCPP")
endif()

list(APPEND _fv3dycore_defs_private CCPP)

if(OpenMP_Fortran_FOUND)
list(APPEND _fv3dycore_defs_private OPENMP)
endif()

set_property(SOURCE atmos_cubed_sphere/model/nh_utils.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")
set_property(SOURCE atmos_cubed_sphere/model/fv_mapz.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")

set_target_properties(fv3dycore PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(fv3dycore PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>)

target_link_libraries(fv3dycore PRIVATE fms)
target_link_libraries(fv3dycore PRIVATE gfsphysics)
target_link_libraries(fv3dycore PRIVATE ipd)
target_link_libraries(fv3dycore PRIVATE esmf)

target_include_directories(fv3dycore PRIVATE atmos_cubed_sphere ${ESMF_MOD})
target_compile_definitions(fv3dycore PRIVATE "${_fv3dycore_defs_private}")
target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere
${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere/tools
${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
target_include_directories(fv3dycore INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)

target_link_libraries(fv3dycore PUBLIC fms
ccppphys
ccppdata
esmf)
if(OpenMP_Fortran_FOUND)
target_link_libraries(fv3dycore PUBLIC OpenMP::OpenMP_Fortran)
endif()

###############################################################################
### ccpp
### CCPP
###############################################################################
if(CCPP)
add_subdirectory(ccpp)
add_subdirectory(ccpp/driver)

add_dependencies(gfsphysics ccpp ccppphys)
add_dependencies(ccppdriver ccpp ccppphys)
add_dependencies(ccppphys ccpp)

target_include_directories(fv3dycore PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src)
target_include_directories(fv3dycore PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/driver)

target_link_libraries(ccppphys PRIVATE sp::sp_d)
target_link_libraries(ccppphys PRIVATE w3nco::w3nco_d)
endif()
add_subdirectory(ccpp)
add_subdirectory(ccpp/data)
add_subdirectory(ccpp/driver)
add_dependencies(ccppphys ccpp)
add_dependencies(ccppdata ccpp ccppphys)
add_dependencies(ccppdriver ccpp ccppphys ccppdata)
add_dependencies(fv3dycore ccppdriver ccpp ccppphys ccppdata)
target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/framework/src
${CMAKE_CURRENT_BINARY_DIR}/ccpp/physics
${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver)
target_link_libraries(ccppphys PUBLIC sp::sp_d
w3nco::w3nco_d)

###############################################################################
### stochastic_physics
Expand All @@ -100,56 +147,63 @@ add_subdirectory(stochastic_physics)
###############################################################################
### fv3atm
###############################################################################
add_library(
fv3atm
add_library(fv3atm
atmos_model.F90
fv3_cap.F90
module_fv3_config.F90
module_fcst_grid_comp.F90
time_utils.F90)

atmos_model.F90
fv3_cap.F90
module_fv3_config.F90
module_fcst_grid_comp.F90
time_utils.F90
)
list(APPEND _fv3atm_defs_private GFS_PHYS
INTERNAL_FILE_NML
ESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR})

set_target_properties(fv3atm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(fv3atm PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>)
target_include_directories(fv3atm INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)

list(APPEND _fv3atm_defs_private CCPP)
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/physics
${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
set(CCPP_LIBRARIES ccppdriver ccppdata ccppphys ccpp)
add_dependencies(fv3atm ccppdriver ccppdata ccppphys ccpp)
target_link_libraries(fv3atm PUBLIC ccppdriver ccppdata ccppphys ccpp)

if(CCPP)
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
set(CCPP_LIBRARIES ccppdriver ccppphys ccpp)
add_dependencies(fv3atm ccppdriver ccppphys ccpp)
target_link_libraries(fv3atm PUBLIC ccppdriver ccppphys ccpp)
endif()
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/stochastic_physics)
target_compile_definitions(fv3atm PRIVATE -DESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR})

target_link_libraries(fv3atm PUBLIC fms)
target_link_libraries(fv3atm PUBLIC cpl)
target_link_libraries(fv3atm PUBLIC gfsphysics)
target_link_libraries(fv3atm PUBLIC ipd)
target_link_libraries(fv3atm PUBLIC io)
target_link_libraries(fv3atm PUBLIC fv3dycore)
target_link_libraries(fv3atm PUBLIC stochastic_physics)
target_link_libraries(fv3atm PUBLIC stochastic_physics_wrapper)

target_link_libraries(fv3atm PUBLIC
nemsio::nemsio w3emc::w3emc_d w3nco::w3nco_d sp::sp_d bacio::bacio_4)
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../stochastic_physics)
target_compile_definitions(fv3atm PRIVATE "${_fv3atm_defs_private}")

target_link_libraries(fv3atm PUBLIC fv3dycore
cpl
io
stochastic_physics
stochastic_physics_wrapper)

target_link_libraries(fv3atm PUBLIC nemsio::nemsio
w3emc::w3emc_d
w3nco::w3nco_d
sp::sp_d
bacio::bacio_4
esmf)

if(INLINE_POST)
target_link_libraries(fv3atm PUBLIC nceppost::nceppost)
target_link_libraries(fv3atm PUBLIC upp::upp)
endif()

target_link_libraries(fv3atm PUBLIC esmf)
if(OpenMP_Fortran_FOUND)
target_link_libraries(fv3atm PUBLIC OpenMP::OpenMP_Fortran)
endif()

###############################################################################
### Install
###############################################################################
install(
TARGETS fv3atm fv3dycore io ipd gfsphysics ${CCPP_LIBRARIES} cpl stochastic_physics stochastic_physics_wrapper
TARGETS fv3atm fv3dycore io ${CCPP_LIBRARIES} cpl stochastic_physics_wrapper
EXPORT fv3atm-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX})

install(EXPORT fv3atm-config
DESTINATION lib/cmake
)

DESTINATION lib/cmake)
14 changes: 0 additions & 14 deletions CODEOWNERS

This file was deleted.

32 changes: 0 additions & 32 deletions README.md

This file was deleted.

2 changes: 1 addition & 1 deletion atmos_cubed_sphere
Submodule atmos_cubed_sphere updated 51 files
+23 −0 .github/pull_request_template.md
+0 −14 CODEOWNERS
+14 −14 README.md
+59 −57 docs/Doxyfile
+1 −1 driver/fvGFS/DYCORE_typedefs.F90
+220 −125 driver/fvGFS/atmosphere.F90
+26 −26 driver/fvGFS/fv_nggps_diag.F90
+0 −7 makefile
+14 −531 model/a2b_edge.F90
+109 −115 model/boundary.F90
+72 −65 model/dyn_core.F90
+699 −737 model/fv_arrays.F90
+0 −1,209 model/fv_cmp.F90
+297 −280 model/fv_control.F90
+91 −121 model/fv_dynamics.F90
+16 −16 model/fv_fill.F90
+195 −199 model/fv_grid_utils.F90
+173 −204 model/fv_mapz.F90
+173 −169 model/fv_nesting.F90
+98 −98 model/fv_regional_bc.F90
+68 −124 model/fv_sg.F90
+848 −822 model/fv_tracer2d.F90
+29 −28 model/fv_update_phys.F90
+8 −8 model/multi_gases.F90
+8 −8 model/nh_core.F90
+2,338 −2,218 model/nh_utils.F90
+3,368 −3,372 model/sw_core.F90
+1,388 −1,242 model/tp_core.F90
+1,365 −0 tools/coarse_grained_diagnostics.F90
+584 −0 tools/coarse_grained_restart_files.F90
+881 −0 tools/coarse_graining.F90
+4,581 −3,889 tools/external_ic.F90
+7 −7 tools/external_sst.F90
+597 −0 tools/fv_diag_column.F90
+1,410 −1,116 tools/fv_diagnostics.F90
+101 −0 tools/fv_diagnostics.h
+112 −107 tools/fv_eta.F90
+44 −5 tools/fv_eta.h
+509 −190 tools/fv_grid_tools.F90
+26 −19 tools/fv_iau_mod.F90
+41 −38 tools/fv_io.F90
+190 −395 tools/fv_mp_mod.F90
+288 −212 tools/fv_nudge.F90
+94 −74 tools/fv_restart.F90
+40 −41 tools/fv_surf_map.F90
+7 −7 tools/fv_timing.F90
+19 −20 tools/fv_treat_da_inc.F90
+40 −27 tools/init_hydro.F90
+6 −6 tools/sim_nc_mod.F90
+34 −34 tools/sorted_index.F90
+263 −2,456 tools/test_cases.F90
Loading

0 comments on commit 0e197f9

Please sign in to comment.