From 707bb626094e940c5ee5226dc8a37b767bcf07eb Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Tue, 24 Dec 2024 17:43:08 -0700 Subject: [PATCH 1/2] Reorganize project structure to allow multiple dycores. Isolate FV3 dycore. Co-authored-by: dustinswales --- .gitmodules | 4 +- CMakeLists.txt | 276 ++++++++++-------- ccpp/CMakeLists.txt | 61 ++-- atmos_cubed_sphere => fv3/atmos_cubed_sphere | 0 atmos_model.F90 => fv3/atmos_model.F90 | 0 .../ccpp}/config/ccpp_prebuild_config.py | 8 +- fv3_cap.F90 => fv3/fv3_cap.F90 | 0 .../module_fcst_grid_comp.F90 | 0 .../module_fv3_config.F90 | 0 9 files changed, 190 insertions(+), 159 deletions(-) rename atmos_cubed_sphere => fv3/atmos_cubed_sphere (100%) rename atmos_model.F90 => fv3/atmos_model.F90 (100%) rename {ccpp => fv3/ccpp}/config/ccpp_prebuild_config.py (98%) rename fv3_cap.F90 => fv3/fv3_cap.F90 (100%) rename module_fcst_grid_comp.F90 => fv3/module_fcst_grid_comp.F90 (100%) rename module_fv3_config.F90 => fv3/module_fv3_config.F90 (100%) diff --git a/.gitmodules b/.gitmodules index 22c723ac1..a01232401 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ -[submodule "atmos_cubed_sphere"] - path = atmos_cubed_sphere +[submodule "fv3/atmos_cubed_sphere"] + path = fv3/atmos_cubed_sphere url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere branch = dev/emc [submodule "ccpp/framework"] diff --git a/CMakeLists.txt b/CMakeLists.txt index dca5d7a2e..75f70354a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -# This is the main CMake file for fv3atm. +# This is the main CMake file for ufsatm. # -# Dusan Jovic, Alex Richert +# Dusan Jovic, Alex Richert, Dustin Swales cmake_minimum_required(VERSION 3.19) # Handle user build options. @@ -15,179 +15,197 @@ endif() # Enable CI build & unit testing: if(BUILD_TESTING) - project(fv3atm VERSION 1.0 LANGUAGES C CXX Fortran) + if (FV3) + project(ufsatm_fv3 VERSION 1.0 LANGUAGES C CXX Fortran) + endif() include(ci/CMakeLists.txt) endif() +# Set variables for all dycore build options in UFSATM. +set(DYCORE_TARGET_FV3 ufsatm_fv3) + ############################################################################### -### CCPP +### Dynamical Cores ############################################################################### +# CCPP set(MPI ON) 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) -if(MOVING_NEST) - set(MOVING_NEST ON) -endif() -if(HYDRO) - set(HYDRO ON) -endif() -add_subdirectory(atmos_cubed_sphere) -target_compile_definitions(fv3 PRIVATE BYPASS_BREED_SLP_INLINE) - -############################################################################### -### fv3atm -############################################################################### -if(INLINE_POST) - set(BUILD_POSTEXEC OFF) - add_subdirectory(upp) - set(POST_SRC io/post_nems_routines.F90 io/post_fv3.F90) - list(APPEND _fv3atm_defs_private INLINE_POST) -endif() - if(CCPP_32BIT) add_definitions(-DCCPP_32BIT) else() remove_definitions(-DCCPP_32BIT) endif() +# Pnetcdf if(NOT PARALLEL_NETCDF) - list(APPEND _fv3atm_defs_private NO_PARALLEL_NETCDF) + list(APPEND _ufsatm_defs_private NO_PARALLEL_NETCDF) endif() if(ENABLE_PARALLELRESTART) - list(APPEND _fv3atm_defs_private ENABLE_PARALLELRESTART) + list(APPEND _ufsatm_defs_private ENABLE_PARALLELRESTART) endif() if(ENABLE_RRFS_WAR) - list(APPEND _fv3atm_defs_private ENABLE_RRFS_WAR) + list(APPEND _ufsatm_defs_private ENABLE_RRFS_WAR) endif() -if(MOVING_NEST) - list(APPEND _fv3atm_defs_private MOVING_NEST) - if(NOT HYDRO) - list(APPEND _fv3atm_defs_private MOIST_CAPPA USE_COND) - endif() +if(BUILD_TESTING) + include(CTest) + add_subdirectory(tests) +endif() - if(DEBUG) - list(APPEND _fv3atm_defs_private DEBUG) - endif() - if(GFS_PHYS) - list(APPEND _fv3atm_defs_private GFS_PHYS) - endif() - if(GFS_TYPES) - list(APPEND _fv3atm_defs_private GFS_TYPES) - endif() - if(USE_GFSL63) - list(APPEND _fv3atm_defs_private USE_GFSL63) +############################################################################### +### UFSATM with FV3 dynamical core +############################################################################### +if (FV3) + set(DYCORE_TARGET ${DYCORE_TARGET_FV3} + CACHE INTERNAL "DYCORE_TARGET Options: fv3atm") + set(DYCORE_TARGET_CAP_MOD fv3atm_cap_mod PARENT_SCOPE) + + + # 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) + if(MOVING_NEST) + set(MOVING_NEST ON) endif() - if(INTERNAL_FILE_NML) - list(APPEND _fv3atm_defs_private INTERNAL_FILE_NML) + + if(HYDRO) + set(HYDRO ON) endif() - if(ENABLE_QUAD_PRECISION) - list(APPEND _fv3atm_defs_private ENABLE_QUAD_PRECISION) + add_subdirectory(fv3/atmos_cubed_sphere) + target_compile_definitions(fv3 PRIVATE BYPASS_BREED_SLP_INLINE) + + if(INLINE_POST) + set(BUILD_POSTEXEC OFF) + add_subdirectory(upp) + set(POST_SRC io/post_nems_routines.F90 io/post_fv3.F90) + list(APPEND _ufsatm_defs_private INLINE_POST) endif() - if(32BIT) - list(APPEND _fv3atm_defs_private OVERLOAD_R4 OVERLOAD_R8) + + if(MOVING_NEST) + list(APPEND _ufsatm_defs_private MOVING_NEST) + if(NOT HYDRO) + list(APPEND _ufsatm_defs_private MOIST_CAPPA USE_COND) + endif() + + if(DEBUG) + list(APPEND _ufsatm_defs_private DEBUG) + endif() + if(GFS_PHYS) + list(APPEND _ufsatm_defs_private GFS_PHYS) + endif() + if(GFS_TYPES) + list(APPEND _ufsatm_defs_private GFS_TYPES) + endif() + if(USE_GFSL63) + list(APPEND _ufsatm_defs_private USE_GFSL63) + endif() + if(INTERNAL_FILE_NML) + list(APPEND _ufsatm_defs_private INTERNAL_FILE_NML) + endif() + if(ENABLE_QUAD_PRECISION) + list(APPEND _ufsatm_defs_private ENABLE_QUAD_PRECISION) + endif() + if(32BIT) + list(APPEND _ufsatm_defs_private OVERLOAD_R4 OVERLOAD_R8) + endif() + + list(APPEND moving_nest_srcs + moving_nest/bounding_box.F90 + moving_nest/fv_tracker.F90 + moving_nest/fv_moving_nest.F90 + moving_nest/fv_moving_nest_main.F90 + moving_nest/fv_moving_nest_physics.F90 + moving_nest/fv_moving_nest_types.F90 + moving_nest/fv_moving_nest_utils.F90 + ) + else() + list(APPEND moving_nest_srcs "") endif() - list(APPEND moving_nest_srcs - moving_nest/bounding_box.F90 - moving_nest/fv_tracker.F90 - moving_nest/fv_moving_nest.F90 - moving_nest/fv_moving_nest_main.F90 - moving_nest/fv_moving_nest_physics.F90 - moving_nest/fv_moving_nest_types.F90 - moving_nest/fv_moving_nest_utils.F90 - ) -else() - list(APPEND moving_nest_srcs "") + # FV3 drivers and dependencies + add_library(${DYCORE_TARGET} + fv3/atmos_model.F90 + fv3/fv3_cap.F90 + fv3/module_fv3_config.F90 + fv3/module_fcst_grid_comp.F90 + stochastic_physics/stochastic_physics_wrapper.F90 + cpl/module_block_data.F90 + cpl/module_cplfields.F90 + cpl/module_cap_cpl.F90 + cpl/module_cplscalars.F90 + io/fv3atm_common_io.F90 + io/fv3atm_clm_lake_io.F90 + io/fv3atm_rrfs_sd_io.F90 + io/fv3atm_sfc_io.F90 + io/fv3atm_oro_io.F90 + io/fv3atm_history_io.F90 + io/fv3atm_restart_io.F90 + io/module_write_netcdf.F90 + io/module_write_restart_netcdf.F90 + io/module_fv3_io_def.F90 + io/module_write_internal_state.F90 + io/module_wrt_grid_comp.F90 + ${moving_nest_srcs} + ${POST_SRC} + ) + add_dependencies(${DYCORE_TARGET} fv3 fv3ccpp stochastic_physics) + + list(APPEND _ufsatm_defs_private GFS_PHYS + INTERNAL_FILE_NML + use_WRTCOMP) endif() -add_library(fv3atm - atmos_model.F90 - fv3_cap.F90 - module_fv3_config.F90 - module_fcst_grid_comp.F90 - stochastic_physics/stochastic_physics_wrapper.F90 - cpl/module_block_data.F90 - cpl/module_cplfields.F90 - cpl/module_cap_cpl.F90 - cpl/module_cplscalars.F90 - io/fv3atm_common_io.F90 - io/fv3atm_clm_lake_io.F90 - io/fv3atm_rrfs_sd_io.F90 - io/fv3atm_sfc_io.F90 - io/fv3atm_oro_io.F90 - io/fv3atm_history_io.F90 - io/fv3atm_restart_io.F90 - io/module_write_netcdf.F90 - io/module_write_restart_netcdf.F90 - io/module_fv3_io_def.F90 - io/module_write_internal_state.F90 - io/module_wrt_grid_comp.F90 - ${moving_nest_srcs} - ${POST_SRC} -) - -add_dependencies(fv3atm fv3 fv3ccpp stochastic_physics) - -list(APPEND _fv3atm_defs_private GFS_PHYS - INTERNAL_FILE_NML - use_WRTCOMP) - -target_compile_definitions(fv3atm PRIVATE "${_fv3atm_defs_private}") - -set_target_properties(fv3atm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) -target_include_directories(fv3atm INTERFACE $ - $) - -if(MULTI_GASES) - list(APPEND _fv3atm_defs_private MULTI_GASES) + +############################################################################### +### Link libraries +############################################################################### + +# set target properties +target_compile_definitions(${DYCORE_TARGET} PRIVATE "${_ufsatm_defs_private}") + +set_target_properties(${DYCORE_TARGET} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) +target_include_directories(${DYCORE_TARGET} INTERFACE $ + $) +# link target +if (FV3) + target_link_libraries(${DYCORE_TARGET} PUBLIC fv3 + fv3ccpp + stochastic_physics + fms) + if(INLINE_POST) + target_link_libraries(${DYCORE_TARGET} PUBLIC upp::upp) + endif() endif() -target_link_libraries(fv3atm PUBLIC fv3 - fv3ccpp - stochastic_physics - fms) -target_link_libraries(fv3atm PUBLIC w3emc::w3emc_d - sp::sp_d - bacio::bacio_4 - esmf) -if(INLINE_POST) - target_link_libraries(fv3atm PUBLIC upp::upp) -endif() +# Always include EMC libraries in dycore install +target_link_libraries(${DYCORE_TARGET} PUBLIC w3emc::w3emc_d + sp::sp_d + bacio::bacio_4 + esmf) +# OpenMP if(OPENMP) - target_link_libraries(fv3atm PUBLIC OpenMP::OpenMP_Fortran) -endif() - -if(BUILD_TESTING) - include(CTest) - add_subdirectory(tests) + target_link_libraries(${DYCORE_TARGET} PUBLIC OpenMP::OpenMP_Fortran) endif() ############################################################################### -### Install +### Install UFSATM ############################################################################### install( - TARGETS fv3atm - EXPORT fv3atm-config + TARGETS ${DYCORE_TARGET} + EXPORT ufsatm-config LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(EXPORT fv3atm-config +install(EXPORT ufsatm-config DESTINATION lib/cmake) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index e9a5d56c7..7fde28785 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -1,8 +1,28 @@ cmake_minimum_required(VERSION 3.0) -project(CCPP-FV3 +project(CCPP-UFS LANGUAGES C CXX Fortran) -set(PROJECT "CCPP-FV3") +set(PROJECT "CCPP-UFS") + +#------------------------------------------------------------------------------ +# FV3 dynamical core +#------------------------------------------------------------------------------ +if (FV3) + message(STATUS "Build CCPP interface to FV3 dynamical core") + set(CCPP_TARGET fv3ccpp) + set(CCPP_PREBUILD_CONFIG ../fv3/ccpp/config/ccpp_prebuild_config.py) + set(DYCORE_CCPP_SRCS + GFS_diagnostics.F90 + GFS_restart.F90 + GFS_init.F90 + CCPP_driver.F90 + ) + list(TRANSFORM DYCORE_CCPP_SRCS PREPEND ../ccpp/driver/) + + # Add dycore-specific preprocessor flag (needed for some physics schemes) + add_definitions(-DFV3) + +endif() #------------------------------------------------------------------------------ # Set a default build type if none was specified @@ -29,7 +49,7 @@ else() endif() execute_process(COMMAND ${Python_EXECUTABLE} "framework/scripts/ccpp_prebuild.py" - "--config=config/ccpp_prebuild_config.py" + "--config=${CCPP_PREBUILD_CONFIG}" "--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg} ${_ccpp_verbose_arg} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.out @@ -40,10 +60,6 @@ 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 host-model specific preprocessor flag (needed for some physics schemes) -add_definitions(-DFV3) - #------------------------------------------------------------------------------ # Set MPI flags for C/C++/Fortran preprocessor if(MPI) @@ -103,43 +119,40 @@ add_subdirectory(framework) add_subdirectory(physics) #------------------------------------------------------------------------------ -# Build fv3ccpp +# Build CCPP_TARGET # Can we move data/*.F90 and driver/*.F90 to this directory ??? add_library( - fv3ccpp - - driver/GFS_diagnostics.F90 - driver/GFS_restart.F90 - driver/GFS_init.F90 - driver/CCPP_driver.F90 - + ${CCPP_TARGET} + ${DYCORE_CCPP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/physics/ccpp_static_api.F90 ) # Compile GFS_diagnostics.F90 without optimization, this leads to out of memory errors on wcoss_dell_p3 -set_property(SOURCE driver/GFS_diagnostics.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "-O0") +if (FV3) + set_property(SOURCE ../fv3/ccpp/driver/GFS_diagnostics.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "-O0") +endif() -target_link_libraries(fv3ccpp PUBLIC ccpp_framework) -target_link_libraries(fv3ccpp PUBLIC ccpp_physics) +target_link_libraries(${CCPP_TARGET} PUBLIC ccpp_framework) +target_link_libraries(${CCPP_TARGET} PUBLIC ccpp_physics) if(OPENMP) - target_link_libraries(fv3ccpp PUBLIC OpenMP::OpenMP_Fortran) + target_link_libraries(${CCPP_TARGET} PUBLIC OpenMP::OpenMP_Fortran) endif() -set_target_properties(fv3ccpp PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) -target_include_directories(fv3ccpp PUBLIC $) +set_target_properties(${CCPP_TARGET} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) +target_include_directories(${CCPP_TARGET} PUBLIC $) ############################################################################### ### Install ############################################################################### install( - TARGETS fv3ccpp ccpp_framework ccpp_physics - EXPORT fv3ccpp-config + TARGETS ${CCPP_TARGET} ccpp_framework ccpp_physics + EXPORT ${CCPP_TARGET}-config LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(EXPORT fv3ccpp-config +install(EXPORT ${CCPP_TARGET}-config DESTINATION lib/cmake) diff --git a/atmos_cubed_sphere b/fv3/atmos_cubed_sphere similarity index 100% rename from atmos_cubed_sphere rename to fv3/atmos_cubed_sphere diff --git a/atmos_model.F90 b/fv3/atmos_model.F90 similarity index 100% rename from atmos_model.F90 rename to fv3/atmos_model.F90 diff --git a/ccpp/config/ccpp_prebuild_config.py b/fv3/ccpp/config/ccpp_prebuild_config.py similarity index 98% rename from ccpp/config/ccpp_prebuild_config.py rename to fv3/ccpp/config/ccpp_prebuild_config.py index 5e91f3ef6..a26b39777 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/fv3/ccpp/config/ccpp_prebuild_config.py @@ -22,9 +22,9 @@ 'physics/physics/photochem/module_ozphys.F90', 'physics/physics/photochem/module_h2ophys.F90', 'physics/physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90', - 'data/CCPP_typedefs.F90', - 'data/GFS_typedefs.F90', - 'data/CCPP_data.F90', + '../ccpp/data/CCPP_typedefs.F90', + '../ccpp/data/GFS_typedefs.F90', + '../ccpp/data/CCPP_data.F90', ] TYPEDEFS_NEW_METADATA = { @@ -240,7 +240,7 @@ CAPS_DIR = '{build_dir}/physics' # Directory where the suite definition files are stored -SUITES_DIR = 'suites' +SUITES_DIR = '../ccpp/suites' # Directory where to write static API to STATIC_API_DIR = '{build_dir}/physics' diff --git a/fv3_cap.F90 b/fv3/fv3_cap.F90 similarity index 100% rename from fv3_cap.F90 rename to fv3/fv3_cap.F90 diff --git a/module_fcst_grid_comp.F90 b/fv3/module_fcst_grid_comp.F90 similarity index 100% rename from module_fcst_grid_comp.F90 rename to fv3/module_fcst_grid_comp.F90 diff --git a/module_fv3_config.F90 b/fv3/module_fv3_config.F90 similarity index 100% rename from module_fv3_config.F90 rename to fv3/module_fv3_config.F90 From cdc2533efa57c4e5a915f3625921f91920afd1b5 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 23 Jan 2025 16:07:19 +0000 Subject: [PATCH 2/2] Some more reorganization to isolate the FV3 dycore coupling --- CMakeLists.txt | 42 +++++++++---------- ccpp/{driver => }/CCPP_driver.F90 | 0 ccpp/CMakeLists.txt | 10 ++--- .../config/ccpp_prebuild_config.py | 0 {io => fv3/io}/fv3atm_clm_lake_io.F90 | 0 {io => fv3/io}/fv3atm_common_io.F90 | 0 {io => fv3/io}/fv3atm_history_io.F90 | 0 {io => fv3/io}/fv3atm_oro_io.F90 | 0 {io => fv3/io}/fv3atm_restart_io.F90 | 0 {io => fv3/io}/fv3atm_rrfs_sd_io.F90 | 0 {io => fv3/io}/fv3atm_sfc_io.F90 | 0 {io => fv3/io}/module_fv3_io_def.F90 | 0 .../io}/module_write_internal_state.F90 | 0 {io => fv3/io}/module_write_netcdf.F90 | 0 .../io}/module_write_restart_netcdf.F90 | 0 {io => fv3/io}/module_wrt_grid_comp.F90 | 0 {io => fv3/io}/post_fv3.F90 | 0 {io => fv3/io}/post_nems_routines.F90 | 0 .../moving_nest}/bounding_box.F90 | 0 .../moving_nest}/fv_moving_nest.F90 | 0 .../moving_nest}/fv_moving_nest_main.F90 | 0 .../moving_nest}/fv_moving_nest_physics.F90 | 0 .../moving_nest}/fv_moving_nest_types.F90 | 0 .../moving_nest}/fv_moving_nest_utils.F90 | 0 .../moving_nest}/fv_tracker.F90 | 0 .../stochastic_physics_wrapper.F90 | 0 26 files changed, 26 insertions(+), 26 deletions(-) rename ccpp/{driver => }/CCPP_driver.F90 (100%) rename {fv3/ccpp => ccpp}/config/ccpp_prebuild_config.py (100%) rename {io => fv3/io}/fv3atm_clm_lake_io.F90 (100%) rename {io => fv3/io}/fv3atm_common_io.F90 (100%) rename {io => fv3/io}/fv3atm_history_io.F90 (100%) rename {io => fv3/io}/fv3atm_oro_io.F90 (100%) rename {io => fv3/io}/fv3atm_restart_io.F90 (100%) rename {io => fv3/io}/fv3atm_rrfs_sd_io.F90 (100%) rename {io => fv3/io}/fv3atm_sfc_io.F90 (100%) rename {io => fv3/io}/module_fv3_io_def.F90 (100%) rename {io => fv3/io}/module_write_internal_state.F90 (100%) rename {io => fv3/io}/module_write_netcdf.F90 (100%) rename {io => fv3/io}/module_write_restart_netcdf.F90 (100%) rename {io => fv3/io}/module_wrt_grid_comp.F90 (100%) rename {io => fv3/io}/post_fv3.F90 (100%) rename {io => fv3/io}/post_nems_routines.F90 (100%) rename {moving_nest => fv3/moving_nest}/bounding_box.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_moving_nest.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_moving_nest_main.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_moving_nest_physics.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_moving_nest_types.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_moving_nest_utils.F90 (100%) rename {moving_nest => fv3/moving_nest}/fv_tracker.F90 (100%) rename {stochastic_physics => fv3/stochastic_physics}/stochastic_physics_wrapper.F90 (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f70354a..1b73e6f8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ if (FV3) if(INLINE_POST) set(BUILD_POSTEXEC OFF) add_subdirectory(upp) - set(POST_SRC io/post_nems_routines.F90 io/post_fv3.F90) + set(POST_SRC fv3/io/post_nems_routines.F90 fv3/io/post_fv3.F90) list(APPEND _ufsatm_defs_private INLINE_POST) endif() @@ -116,13 +116,13 @@ if (FV3) endif() list(APPEND moving_nest_srcs - moving_nest/bounding_box.F90 - moving_nest/fv_tracker.F90 - moving_nest/fv_moving_nest.F90 - moving_nest/fv_moving_nest_main.F90 - moving_nest/fv_moving_nest_physics.F90 - moving_nest/fv_moving_nest_types.F90 - moving_nest/fv_moving_nest_utils.F90 + fv3/moving_nest/bounding_box.F90 + fv3/moving_nest/fv_tracker.F90 + fv3/moving_nest/fv_moving_nest.F90 + fv3/moving_nest/fv_moving_nest_main.F90 + fv3/moving_nest/fv_moving_nest_physics.F90 + fv3/moving_nest/fv_moving_nest_types.F90 + fv3/moving_nest/fv_moving_nest_utils.F90 ) else() list(APPEND moving_nest_srcs "") @@ -134,23 +134,23 @@ if (FV3) fv3/fv3_cap.F90 fv3/module_fv3_config.F90 fv3/module_fcst_grid_comp.F90 - stochastic_physics/stochastic_physics_wrapper.F90 + fv3/stochastic_physics/stochastic_physics_wrapper.F90 cpl/module_block_data.F90 cpl/module_cplfields.F90 cpl/module_cap_cpl.F90 cpl/module_cplscalars.F90 - io/fv3atm_common_io.F90 - io/fv3atm_clm_lake_io.F90 - io/fv3atm_rrfs_sd_io.F90 - io/fv3atm_sfc_io.F90 - io/fv3atm_oro_io.F90 - io/fv3atm_history_io.F90 - io/fv3atm_restart_io.F90 - io/module_write_netcdf.F90 - io/module_write_restart_netcdf.F90 - io/module_fv3_io_def.F90 - io/module_write_internal_state.F90 - io/module_wrt_grid_comp.F90 + fv3/io/fv3atm_common_io.F90 + fv3/io/fv3atm_clm_lake_io.F90 + fv3/io/fv3atm_rrfs_sd_io.F90 + fv3/io/fv3atm_sfc_io.F90 + fv3/io/fv3atm_oro_io.F90 + fv3/io/fv3atm_history_io.F90 + fv3/io/fv3atm_restart_io.F90 + fv3/io/module_write_netcdf.F90 + fv3/io/module_write_restart_netcdf.F90 + fv3/io/module_fv3_io_def.F90 + fv3/io/module_write_internal_state.F90 + fv3/io/module_wrt_grid_comp.F90 ${moving_nest_srcs} ${POST_SRC} ) diff --git a/ccpp/driver/CCPP_driver.F90 b/ccpp/CCPP_driver.F90 similarity index 100% rename from ccpp/driver/CCPP_driver.F90 rename to ccpp/CCPP_driver.F90 diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 7fde28785..f0554c57e 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -10,14 +10,14 @@ set(PROJECT "CCPP-UFS") if (FV3) message(STATUS "Build CCPP interface to FV3 dynamical core") set(CCPP_TARGET fv3ccpp) - set(CCPP_PREBUILD_CONFIG ../fv3/ccpp/config/ccpp_prebuild_config.py) + set(CCPP_PREBUILD_CONFIG config/ccpp_prebuild_config.py) set(DYCORE_CCPP_SRCS - GFS_diagnostics.F90 - GFS_restart.F90 - GFS_init.F90 + driver/GFS_diagnostics.F90 + driver/GFS_restart.F90 + driver/GFS_init.F90 CCPP_driver.F90 ) - list(TRANSFORM DYCORE_CCPP_SRCS PREPEND ../ccpp/driver/) + #list(TRANSFORM DYCORE_CCPP_SRCS PREPEND ../ccpp/driver/) # Add dycore-specific preprocessor flag (needed for some physics schemes) add_definitions(-DFV3) diff --git a/fv3/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py similarity index 100% rename from fv3/ccpp/config/ccpp_prebuild_config.py rename to ccpp/config/ccpp_prebuild_config.py diff --git a/io/fv3atm_clm_lake_io.F90 b/fv3/io/fv3atm_clm_lake_io.F90 similarity index 100% rename from io/fv3atm_clm_lake_io.F90 rename to fv3/io/fv3atm_clm_lake_io.F90 diff --git a/io/fv3atm_common_io.F90 b/fv3/io/fv3atm_common_io.F90 similarity index 100% rename from io/fv3atm_common_io.F90 rename to fv3/io/fv3atm_common_io.F90 diff --git a/io/fv3atm_history_io.F90 b/fv3/io/fv3atm_history_io.F90 similarity index 100% rename from io/fv3atm_history_io.F90 rename to fv3/io/fv3atm_history_io.F90 diff --git a/io/fv3atm_oro_io.F90 b/fv3/io/fv3atm_oro_io.F90 similarity index 100% rename from io/fv3atm_oro_io.F90 rename to fv3/io/fv3atm_oro_io.F90 diff --git a/io/fv3atm_restart_io.F90 b/fv3/io/fv3atm_restart_io.F90 similarity index 100% rename from io/fv3atm_restart_io.F90 rename to fv3/io/fv3atm_restart_io.F90 diff --git a/io/fv3atm_rrfs_sd_io.F90 b/fv3/io/fv3atm_rrfs_sd_io.F90 similarity index 100% rename from io/fv3atm_rrfs_sd_io.F90 rename to fv3/io/fv3atm_rrfs_sd_io.F90 diff --git a/io/fv3atm_sfc_io.F90 b/fv3/io/fv3atm_sfc_io.F90 similarity index 100% rename from io/fv3atm_sfc_io.F90 rename to fv3/io/fv3atm_sfc_io.F90 diff --git a/io/module_fv3_io_def.F90 b/fv3/io/module_fv3_io_def.F90 similarity index 100% rename from io/module_fv3_io_def.F90 rename to fv3/io/module_fv3_io_def.F90 diff --git a/io/module_write_internal_state.F90 b/fv3/io/module_write_internal_state.F90 similarity index 100% rename from io/module_write_internal_state.F90 rename to fv3/io/module_write_internal_state.F90 diff --git a/io/module_write_netcdf.F90 b/fv3/io/module_write_netcdf.F90 similarity index 100% rename from io/module_write_netcdf.F90 rename to fv3/io/module_write_netcdf.F90 diff --git a/io/module_write_restart_netcdf.F90 b/fv3/io/module_write_restart_netcdf.F90 similarity index 100% rename from io/module_write_restart_netcdf.F90 rename to fv3/io/module_write_restart_netcdf.F90 diff --git a/io/module_wrt_grid_comp.F90 b/fv3/io/module_wrt_grid_comp.F90 similarity index 100% rename from io/module_wrt_grid_comp.F90 rename to fv3/io/module_wrt_grid_comp.F90 diff --git a/io/post_fv3.F90 b/fv3/io/post_fv3.F90 similarity index 100% rename from io/post_fv3.F90 rename to fv3/io/post_fv3.F90 diff --git a/io/post_nems_routines.F90 b/fv3/io/post_nems_routines.F90 similarity index 100% rename from io/post_nems_routines.F90 rename to fv3/io/post_nems_routines.F90 diff --git a/moving_nest/bounding_box.F90 b/fv3/moving_nest/bounding_box.F90 similarity index 100% rename from moving_nest/bounding_box.F90 rename to fv3/moving_nest/bounding_box.F90 diff --git a/moving_nest/fv_moving_nest.F90 b/fv3/moving_nest/fv_moving_nest.F90 similarity index 100% rename from moving_nest/fv_moving_nest.F90 rename to fv3/moving_nest/fv_moving_nest.F90 diff --git a/moving_nest/fv_moving_nest_main.F90 b/fv3/moving_nest/fv_moving_nest_main.F90 similarity index 100% rename from moving_nest/fv_moving_nest_main.F90 rename to fv3/moving_nest/fv_moving_nest_main.F90 diff --git a/moving_nest/fv_moving_nest_physics.F90 b/fv3/moving_nest/fv_moving_nest_physics.F90 similarity index 100% rename from moving_nest/fv_moving_nest_physics.F90 rename to fv3/moving_nest/fv_moving_nest_physics.F90 diff --git a/moving_nest/fv_moving_nest_types.F90 b/fv3/moving_nest/fv_moving_nest_types.F90 similarity index 100% rename from moving_nest/fv_moving_nest_types.F90 rename to fv3/moving_nest/fv_moving_nest_types.F90 diff --git a/moving_nest/fv_moving_nest_utils.F90 b/fv3/moving_nest/fv_moving_nest_utils.F90 similarity index 100% rename from moving_nest/fv_moving_nest_utils.F90 rename to fv3/moving_nest/fv_moving_nest_utils.F90 diff --git a/moving_nest/fv_tracker.F90 b/fv3/moving_nest/fv_tracker.F90 similarity index 100% rename from moving_nest/fv_tracker.F90 rename to fv3/moving_nest/fv_tracker.F90 diff --git a/stochastic_physics/stochastic_physics_wrapper.F90 b/fv3/stochastic_physics/stochastic_physics_wrapper.F90 similarity index 100% rename from stochastic_physics/stochastic_physics_wrapper.F90 rename to fv3/stochastic_physics/stochastic_physics_wrapper.F90