From 479271db01a83c14e6bb47c028284184d724df2d Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 21 Jul 2021 17:10:42 -0400 Subject: [PATCH 01/12] update submodule pointer for dycore and branch of dycore --- .gitmodules | 4 ++-- atmos_cubed_sphere | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index afe6f27dd..673842ebb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere + branch = feature/cmake_in_dycore_of_emc [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 3a0d35ad3..7b6a225f7 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 3a0d35ad3efca351d5b1efccfad58eecf8147f2c +Subproject commit 7b6a225f74891a76a38965114969e230a442409a From dbd59580955bd17e1b1d79b4ff8ccbd912d5da93 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 21 Jul 2021 17:31:31 -0400 Subject: [PATCH 02/12] first cut at cmakelists.txt --- CMakeLists.txt | 101 +++---------------------------------------------- 1 file changed, 6 insertions(+), 95 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b0b80745..ab99240d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,101 +6,10 @@ add_subdirectory(ccpp) ############################################################################### -### fv3dycore +### fv3 dynamical core ############################################################################### -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() - -if(32BIT) - list(APPEND _fv3dycore_defs_private OVERLOAD_R4 - OVERLOAD_R8) -endif() - -if(OPENMP) - 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 INTERFACE $ - $) -target_compile_definitions(fv3dycore PRIVATE "${_fv3dycore_defs_private}") - -# So much for being consistent: -# atmos_cubed_sphere/tools/fv_diagnostics.F90: #include -# atmos_cubed_sphere/tools/fv_eta.F90: #include -target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere - ${CMAKE_CURRENT_SOURCE_DIR}/atmos_cubed_sphere/tools) - -target_link_libraries(fv3dycore PUBLIC fms - fv3ccpp - esmf) -if(OPENMP) - target_link_libraries(fv3dycore PUBLIC OpenMP::OpenMP_Fortran) -endif() - -# This should not be necessary once framework and physics targets define BUILD_INTERFACE -target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/framework/src - ${CMAKE_CURRENT_BINARY_DIR}/ccpp/physics) +add_subdirectory(atmos_cubed_sphere) ############################################################################### ### fv3atm @@ -136,6 +45,8 @@ add_library(fv3atm ${POST_SRC} ) +add_dependencies(fv3atm fv3 fv3ccpp stochastic_physics) + list(APPEND _fv3atm_defs_private GFS_PHYS INTERNAL_FILE_NML use_WRTCOMP) @@ -149,7 +60,7 @@ target_include_directories(fv3atm INTERFACE $ Date: Thu, 22 Jul 2021 11:48:02 -0400 Subject: [PATCH 03/12] updates for dycore cmakelists.txt and submodule pointer --- .gitignore | 10 ++++++++-- CMakeLists.txt | 5 +++++ atmos_cubed_sphere | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ac5fcf245..aafab21cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ -*.o +*.[aox] *.mod -*.a *.pyc + +*.sw[a-p] +~ + +build/ +install/ + diff --git a/CMakeLists.txt b/CMakeLists.txt index ab99240d5..830b572eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,11 @@ add_subdirectory(ccpp) ### fv3 dynamical core ############################################################################### +# These ifdefs need to be turned ON in the dycore. +set(use_WRTCOMP ON) +set(GFS_PHYS ON) +set(GFS_TYPES ON) +set(USE_GFSL63 ON) add_subdirectory(atmos_cubed_sphere) ############################################################################### diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 7b6a225f7..7fdb3a56e 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 7b6a225f74891a76a38965114969e230a442409a +Subproject commit 7fdb3a56e5e38cfd0fd4765dd2f31891f0a67ec7 From e994854ba63ce877897e28570d326a7aa953a9d5 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 5 Aug 2021 07:12:56 -0600 Subject: [PATCH 04/12] CCPP cmake cleanup from Dom first round (#1) * Cleanup of ccpp/CMakeLists.txt now that CCPP is defining build interfaces correctly --- .gitmodules | 12 ++++++++---- ccpp/CMakeLists.txt | 17 +++-------------- ccpp/framework | 2 +- ccpp/physics | 2 +- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.gitmodules b/.gitmodules index 673842ebb..b570a10f8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,13 @@ branch = feature/cmake_in_dycore_of_emc [submodule "ccpp/framework"] path = ccpp/framework - url = https://github.com/NCAR/ccpp-framework - branch = main + #url = https://github.com/NCAR/ccpp-framework + #branch = main + url = https://github.com/climbfuji/ccpp-framework + branch = ccpp_cmake_cleanup [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + #url = https://github.com/NCAR/ccpp-physics + #branch = main + url = https://github.com/climbfuji/ccpp-physics + branch = ccpp_cmake_cleanup diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 9c116d4e6..ba54e738d 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -4,10 +4,6 @@ project(CCPP-FV3 LANGUAGES C CXX Fortran) set(PROJECT "CCPP-FV3") -# Attempt to add link library "NetCDF::NetCDF_Fortran" to target "ccppphys" -# which is not built in this directory. -cmake_policy(SET CMP0079 NEW) - #------------------------------------------------------------------------------ # Set a default build type if none was specified if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) @@ -96,10 +92,7 @@ endif() add_subdirectory(framework) add_subdirectory(physics) -add_dependencies(ccppphys ccpp) -target_link_libraries(ccppphys PUBLIC NetCDF::NetCDF_Fortran) -# This should not be necessary once framework and physics targets define BUILD_INTERFACE -target_include_directories(ccppphys PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/framework/src) +add_dependencies(ccpp_physics ccpp_framework) #------------------------------------------------------------------------------ # Build fv3ccpp @@ -124,16 +117,12 @@ add_library( set_property(SOURCE driver/GFS_diagnostics.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "-O0") -target_link_libraries(fv3ccpp PUBLIC ccpp) -target_link_libraries(fv3ccpp PUBLIC ccppphys) +target_link_libraries(fv3ccpp PUBLIC ccpp_framework) +target_link_libraries(fv3ccpp PUBLIC ccpp_physics) if(OPENMP) target_link_libraries(fv3ccpp PUBLIC OpenMP::OpenMP_Fortran) endif() -# This should not be necessary once framework and physics targets define BUILD_INTERFACE -target_include_directories(fv3ccpp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/framework/src - ${CMAKE_CURRENT_BINARY_DIR}/physics) - set_target_properties(fv3ccpp PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) target_include_directories(fv3ccpp PUBLIC $) diff --git a/ccpp/framework b/ccpp/framework index 075e08e28..b89b0afe9 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 075e08e2887d1dbd4fe95003689eac69aca5f32c +Subproject commit b89b0afe93be2354b7229a712aa7ba6d16f75899 diff --git a/ccpp/physics b/ccpp/physics index 09faa73b9..a9c7465d1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 09faa73b9659a682e904b35ee6c6e127a4c4c2cf +Subproject commit a9c7465d11e026334bd39d14c221554c4d2c3ef5 From 8183df5902b55ae82dcb111f0f33148420091c66 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 10 Sep 2021 10:15:32 -0400 Subject: [PATCH 05/12] update submodule pointer to dycore --- .gitmodules | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.gitmodules b/.gitmodules index b570a10f8..1c5ecb22c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,16 +1,18 @@ [submodule "atmos_cubed_sphere"] - path = atmos_cubed_sphere - url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere - branch = feature/cmake_in_dycore_of_emc + path = atmos_cubed_sphere + #url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere + #branch = dev/emc + url = https://github.com/aerorahul/GFDL_atmos_cubed_sphere + branch = feature/cmake_in_dycore_of_emc [submodule "ccpp/framework"] - path = ccpp/framework - #url = https://github.com/NCAR/ccpp-framework - #branch = main - url = https://github.com/climbfuji/ccpp-framework - branch = ccpp_cmake_cleanup + path = ccpp/framework + #url = https://github.com/NCAR/ccpp-framework + #branch = main + url = https://github.com/climbfuji/ccpp-framework + branch = ccpp_cmake_cleanup [submodule "ccpp/physics"] - path = ccpp/physics - #url = https://github.com/NCAR/ccpp-physics - #branch = main - url = https://github.com/climbfuji/ccpp-physics - branch = ccpp_cmake_cleanup + path = ccpp/physics + #url = https://github.com/NCAR/ccpp-physics + #branch = main + url = https://github.com/climbfuji/ccpp-physics + branch = ccpp_cmake_cleanup From 0d5994a25e5c4d44e8c984e61f199f66e7c24b40 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 10 Sep 2021 10:27:14 -0400 Subject: [PATCH 06/12] update submodule pointers for dycore, ccpp-framework and ccpp-physics --- atmos_cubed_sphere | 2 +- ccpp/framework | 2 +- ccpp/physics | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 7fdb3a56e..a7f174ca1 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 7fdb3a56e5e38cfd0fd4765dd2f31891f0a67ec7 +Subproject commit a7f174ca1647f86d982198c882dfe03c90fa016d diff --git a/ccpp/framework b/ccpp/framework index b89b0afe9..a7a8c2733 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit b89b0afe93be2354b7229a712aa7ba6d16f75899 +Subproject commit a7a8c2733aad9194ef28578d78c61230c5d797ef diff --git a/ccpp/physics b/ccpp/physics index a9c7465d1..ec77768e3 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a9c7465d11e026334bd39d14c221554c4d2c3ef5 +Subproject commit ec77768e3fd6f56559fbd47ecbced737f281cbfe From d1215864d6ba60a3563997447eedffe53488fd39 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 10 Sep 2021 15:26:15 -0400 Subject: [PATCH 07/12] cmake only in dycore of emc for fv3atm --- .gitmodules | 2 +- atmos_cubed_sphere | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1c5ecb22c..60217fc58 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ #url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere #branch = dev/emc url = https://github.com/aerorahul/GFDL_atmos_cubed_sphere - branch = feature/cmake_in_dycore_of_emc + branch = feature/cmake_only_in_dycore_of_emc [submodule "ccpp/framework"] path = ccpp/framework #url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index a7f174ca1..67cb77dce 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit a7f174ca1647f86d982198c882dfe03c90fa016d +Subproject commit 67cb77dceedea87e15ce9f62fb4a9d24e59d1436 From 97f35f1c06f2b2371bbe47fd9cac87ade445c3fc Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 13 Sep 2021 09:03:36 -0400 Subject: [PATCH 08/12] remove fv3ccpp install target from fv3atm and update dycore submodule pointer --- CMakeLists.txt | 2 +- atmos_cubed_sphere | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba9078281..d375d288e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ endif() ### Install ############################################################################### install( - TARGETS fv3atm fv3ccpp + TARGETS fv3atm EXPORT fv3atm-config LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 67cb77dce..eb5bf02ef 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 67cb77dceedea87e15ce9f62fb4a9d24e59d1436 +Subproject commit eb5bf02efd37830bc88cb8fa97b01ed3fd14edec From 8f008dd86983e94955cab7967bccc6e62b30a79f Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 13 Sep 2021 09:18:59 -0400 Subject: [PATCH 09/12] update dycore pointer and install fv3ccpp --- atmos_cubed_sphere | 2 +- ccpp/CMakeLists.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index eb5bf02ef..ec8a0f571 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit eb5bf02efd37830bc88cb8fa97b01ed3fd14edec +Subproject commit ec8a0f5711e2381e931d9d00594bca576d2c70ca diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index f830bc55f..a034f41e9 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -126,3 +126,17 @@ endif() set_target_properties(fv3ccpp PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) target_include_directories(fv3ccpp PUBLIC $) + +############################################################################### +### Install +############################################################################### +install( + TARGETS fv3ccpp ccpp_framework ccpp_physics + EXPORT fv3ccpp-config + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}) + +install(EXPORT fv3ccpp-config + DESTINATION lib/cmake) From 12ece471cc74ad9015fe9beb6aab3d6aee147ae8 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 13 Sep 2021 09:37:24 -0400 Subject: [PATCH 10/12] update ccpp/physics submodule pointer --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ec77768e3..18fb14eb7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ec77768e3fd6f56559fbd47ecbced737f281cbfe +Subproject commit 18fb14eb79777a5edd95daa0c26730df96ba03cf From a89df7b49b0b6c59a2cfbf9ee5d080fee0582aba Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 13 Sep 2021 09:41:19 -0400 Subject: [PATCH 11/12] removed commented line --- ccpp/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index a034f41e9..b614e099f 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -90,9 +90,7 @@ endif() # Build CCPP framework and physics add_subdirectory(framework) - add_subdirectory(physics) -#add_dependencies(ccpp_physics ccpp_framework) ! Not sure if this is needed at all #------------------------------------------------------------------------------ # Build fv3ccpp From 2620c56b3ddcb043d0ab4fa97fd4ab1119180092 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 13 Sep 2021 10:28:26 -0400 Subject: [PATCH 12/12] fix bug in dycore cmakelists --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index ec8a0f571..24f8fbf60 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit ec8a0f5711e2381e931d9d00594bca576d2c70ca +Subproject commit 24f8fbf601be8fd9fe0350e39776708aa6d54e26