Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/aoloso/use moist gfdl mp #42

Open
wants to merge 3 commits into
base: geos/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ esma_set_this ()

set (srcs
tools/fv_treat_da_inc.F90
model/lin_cloud_microphys.F90
model/fv_cmp.F90
geos_utils/fill_corner.F90
geos_utils/flow_proj.F90
Expand Down Expand Up @@ -48,15 +47,20 @@ set (srcs
geos_utils/rs_scaleMod.F90
)

# You can't use generator expressions in set()
if (USE_GFDL_MP_FROM_FV)
list(APPEND srcs model/lin_cloud_microphys.F90)
endif ()

if (ESMA_USE_GFE_NAMESPACE)
esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL GFTL_SHARED::gftl-shared
DEPENDENCIES MAPL GFTL_SHARED::gftl-shared $<$<NOT:$<BOOL:${USE_GFDL_MP_FROM_FV}>>:GEOSmoist_GridComp>
INCLUDES ${INC_ESMF})
else ()
esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL gftl-shared
DEPENDENCIES MAPL gftl-shared $<$<NOT:$<BOOL:${USE_GFDL_MP_FROM_FV}>>:GEOSmoist_GridComp>
INCLUDES ${INC_ESMF})
endif ()

Expand All @@ -83,6 +87,10 @@ elseif (FV_PRECISION STREQUAL R8)
endforeach()
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}")

if (CRAY_POINTER)
Expand Down
7 changes: 7 additions & 0 deletions model/fv_cmp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ module fv_cmp_mod
use constants_mod, only: rvgas, rdgas, grav, hlv, hlf, cp_air
use fv_mp_mod, only: is_master
use fv_arrays_mod, only: r_grid
#ifdef USE_GFDL_MP_FROM_FV
use gfdl_cloud_microphys_mod, only: ql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt
use gfdl_cloud_microphys_mod, only: icloud_f, sat_adj0, t_sub, cld_min
use gfdl_cloud_microphys_mod, only: tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r
use gfdl_cloud_microphys_mod, only: rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land
#else
use gfdl2_cloud_microphys_mod, only: ql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt
use gfdl2_cloud_microphys_mod, only: icloud_f, sat_adj0, t_sub, cld_min
use gfdl2_cloud_microphys_mod, only: tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r
use gfdl2_cloud_microphys_mod, only: rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land
#endif

implicit none

Expand Down
4 changes: 4 additions & 0 deletions model/fv_sg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ module fv_sg_mod
use constants_mod, only: rdgas, rvgas, cp_air, cp_vapor, hlv, hlf, kappa, grav
use tracer_manager_mod, only: get_tracer_index
use field_manager_mod, only: MODEL_ATMOS
#ifdef USE_GFDL_MP_FROM_FV
use gfdl_cloud_microphys_mod, only: wqs2, wqsat2_moist
#else
use gfdl2_cloud_microphys_mod, only: wqs2, wqsat2_moist
#endif
use fv_mp_mod, only: mp_reduce_min, is_master

implicit none
Expand Down
9 changes: 6 additions & 3 deletions model/mapz-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(srcs
../fv_fill.F90
../fv_arrays.F90
../fv_cmp.F90
../lin_cloud_microphys.F90

../../tools/fv_timing.F90
../../tools/fv_mp_mod.F90
Expand All @@ -22,6 +21,10 @@ set(srcs
output/output.f90
main.F90)

if (USE_GFDL_MP_FROM_FV)
list(APPEND srcs ../lin_cloud_microphys.F90)
endif ()

if (FV_PRECISION STREQUAL R4)
set(FMS fms_r4)
elseif (FV_PRECISION STREQUAL R4R8) # FV is R4 but FMS is R8
Expand All @@ -33,7 +36,7 @@ endif ()
ecbuild_add_executable(
TARGET mapz-driver
SOURCES ${srcs}
LIBS ${FMS} MAPL)
target_compile_definitions(mapz-driver PRIVATE MAPL_MODE SPMD TIMING)
LIBS ${FMS} MAPL $<$<NOT:$<BOOL:${USE_GFDL_MP_FROM_FV}>>:GEOSmoist_GridComp>)
target_compile_definitions(mapz-driver PRIVATE MAPL_MODE SPMD TIMING $<$<BOOL:${USE_GFDL_MP_FROM_FV}>:USE_GFDL_MP_FROM_FV>)
target_compile_options(mapz-driver PRIVATE ${TRACEBACK})
set_target_properties(${this} PROPERTIES Fortran_MODULE_DIRECTORY ${esma_include}/${this})
4 changes: 4 additions & 0 deletions tools/fv_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ module fv_diagnostics_mod
use sat_vapor_pres_mod, only: compute_qs, lookup_es

use fv_arrays_mod, only: max_step
#ifdef USE_GFDL_MP_FROM_FV
use gfdl_cloud_microphys_mod, only: wqs1, qsmith_init
#else
use gfdl2_cloud_microphys_mod, only: wqs1, qsmith_init
#endif

implicit none
private
Expand Down