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/.gitmodules b/.gitmodules index afe6f27dd..60217fc58 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,18 @@ [submodule "atmos_cubed_sphere"] - path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/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_only_in_dycore_of_emc [submodule "ccpp/framework"] - path = ccpp/framework - url = https://github.com/NCAR/ccpp-framework - branch = main + 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 + path = ccpp/physics + #url = https://github.com/NCAR/ccpp-physics + #branch = main + url = https://github.com/climbfuji/ccpp-physics + branch = ccpp_cmake_cleanup diff --git a/CMakeLists.txt b/CMakeLists.txt index 4766a17d3..d375d288e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,103 +6,15 @@ 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 - INTERNAL_FILE_NML - ENABLE_QUAD_PRECISION - 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) +# 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) ############################################################################### ### fv3atm @@ -136,6 +48,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 +63,7 @@ target_include_directories(fv3atm INTERFACE $) + +############################################################################### +### 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) diff --git a/ccpp/framework b/ccpp/framework index 922fe4494..a7a8c2733 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 922fe44948acddaec6bc08d2392beaa047fe2587 +Subproject commit a7a8c2733aad9194ef28578d78c61230c5d797ef diff --git a/ccpp/physics b/ccpp/physics index cb2b5166a..18fb14eb7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cb2b5166af5b5c5b284d910f36be31f67b325e8c +Subproject commit 18fb14eb79777a5edd95daa0c26730df96ba03cf