From 56fa2b5a131b32c52fd6f74d2d638d277d5eca9e Mon Sep 17 00:00:00 2001 From: Amidu Oloso Date: Tue, 15 Jun 2021 17:21:50 -0400 Subject: [PATCH 1/2] Changes to eliminate duplicate gfdl_cloud_microphysics. Both moist and dycore now uses the one in moist --- CMakeLists.txt | 4 ++-- FV_StateMod.F90 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa43888..9c39238 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,9 @@ set (srcs ) if (ESMA_USE_GFE_NAMESPACE) - set(dependencies MAPL GFTL_SHARED::gftl-shared GMAO_hermes GEOS_Shared) + set(dependencies MAPL GFTL_SHARED::gftl-shared GMAO_hermes GEOS_Shared GEOSmoist_GridComp) else () - set(dependencies MAPL gftl-shared GMAO_hermes GEOS_Shared) + set(dependencies MAPL gftl-shared GMAO_hermes GEOS_Shared GEOSmoist_GridComp) endif () esma_add_library (${this} diff --git a/FV_StateMod.F90 b/FV_StateMod.F90 index 258ce95..74eabc9 100644 --- a/FV_StateMod.F90 +++ b/FV_StateMod.F90 @@ -31,7 +31,7 @@ module FV_StateMod use fv_update_phys_mod, only: fv_update_phys use sw_core_mod, only: d2a2c_vect use fv_sg_mod, only: fv_subgrid_z - use gfdl_cloud_microphys_mod, only: gfdl_cloud_microphys_init + use gfdl2_cloud_microphys_mod, only: gfdl_cloud_microphys_init ! gfdl_cloud_microphys_mod as gfdl2_cloud_microphysics from moist use fv_diagnostics_mod, only: prt_maxmin, prt_minmax From e420721d1f1638c9910e0e79dd913657981295b8 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 16 Jun 2021 10:57:33 -0400 Subject: [PATCH 2/2] Add option to allow building with either Moist or FV microphysics --- CMakeLists.txt | 9 +++++++-- FV_StateMod.F90 | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c39238..2d40375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,11 @@ set (srcs ) if (ESMA_USE_GFE_NAMESPACE) - set(dependencies MAPL GFTL_SHARED::gftl-shared GMAO_hermes GEOS_Shared GEOSmoist_GridComp) + set(dependencies MAPL GFTL_SHARED::gftl-shared GMAO_hermes GEOS_Shared + $<$>:GEOSmoist_GridComp>) else () - set(dependencies MAPL gftl-shared GMAO_hermes GEOS_Shared GEOSmoist_GridComp) + set(dependencies MAPL gftl-shared GMAO_hermes GEOS_Shared + $<$>:GEOSmoist_GridComp>) endif () esma_add_library (${this} @@ -49,6 +51,9 @@ elseif (FV_PRECISION MATCHES R4R8) # FV is R4 but FMS is R8 target_compile_definitions (${this} PRIVATE -DSINGLE_FV -DOVERLOAD_R4) endif () +if (USE_GFDL_MP_FROM_FV) + target_compile_definitions (${this} PRIVATE USE_GFDL_MP_FROM_FV) +endif () set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}") diff --git a/FV_StateMod.F90 b/FV_StateMod.F90 index 74eabc9..efff9f5 100644 --- a/FV_StateMod.F90 +++ b/FV_StateMod.F90 @@ -31,7 +31,11 @@ module FV_StateMod use fv_update_phys_mod, only: fv_update_phys use sw_core_mod, only: d2a2c_vect use fv_sg_mod, only: fv_subgrid_z +#ifdef USE_GFDL_MP_FROM_FV + use gfdl_cloud_microphys_mod, only: gfdl_cloud_microphys_init +#else use gfdl2_cloud_microphys_mod, only: gfdl_cloud_microphys_init ! gfdl_cloud_microphys_mod as gfdl2_cloud_microphysics from moist +#endif use fv_diagnostics_mod, only: prt_maxmin, prt_minmax