Skip to content

Commit

Permalink
Does not compile with templated Microphysics.H but does compile with …
Browse files Browse the repository at this point in the history
…the case select version (commented out).
  • Loading branch information
AMLattanzi committed Nov 16, 2023
1 parent 7fe006a commit e248a47
Show file tree
Hide file tree
Showing 29 changed files with 1,729 additions and 170 deletions.
16 changes: 9 additions & 7 deletions CMake/BuildERFExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ function(build_erf_lib erf_lib_name)

if(ERF_ENABLE_MOISTURE)
target_sources(${erf_lib_name} PRIVATE
${SRC_DIR}/Microphysics/Init.cpp
${SRC_DIR}/Microphysics/Cloud.cpp
${SRC_DIR}/Microphysics/IceFall.cpp
${SRC_DIR}/Microphysics/Precip.cpp
${SRC_DIR}/Microphysics/PrecipFall.cpp
${SRC_DIR}/Microphysics/Diagnose.cpp
${SRC_DIR}/Microphysics/Update.cpp)
${SRC_DIR}/Microphysics/SAM/Init.cpp
${SRC_DIR}/Microphysics/SAM/Cloud.cpp
${SRC_DIR}/Microphysics/SAM/IceFall.cpp
${SRC_DIR}/Microphysics/SAM/Precip.cpp
${SRC_DIR}/Microphysics/SAM/PrecipFall.cpp
${SRC_DIR}/Microphysics/SAM/Diagnose.cpp
${SRC_DIR}/Microphysics/SAM/Update.cpp)
target_compile_definitions(${erf_lib_name} PUBLIC ERF_USE_MOISTURE)
endif()

Expand Down Expand Up @@ -184,6 +184,8 @@ function(build_erf_lib erf_lib_name)

if(ERF_ENABLE_MOISTURE)
target_include_directories(${erf_lib_name} PUBLIC ${SRC_DIR}/Microphysics)
target_include_directories(${erf_lib_name} PUBLIC ${SRC_DIR}/Microphysics/Null)
target_include_directories(${erf_lib_name} PUBLIC ${SRC_DIR}/Microphysics/SAM)
endif()

if(ERF_ENABLE_RRTMGP)
Expand Down
10 changes: 10 additions & 0 deletions Exec/Make.ERF
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ ifeq ($(USE_MOISTURE), TRUE)
include $(ERF_MOISTURE_DIR)/Make.package
VPATH_LOCATIONS += $(ERF_MOISTURE_DIR)
INCLUDE_LOCATIONS += $(ERF_MOISTURE_DIR)

ERF_MOISTURE_NULL_DIR = $(ERF_SOURCE_DIR)/Microphysics/Null
include $(ERF_MOISTURE_NULL_DIR)/Make.package
VPATH_LOCATIONS += $(ERF_MOISTURE_NULL_DIR)
INCLUDE_LOCATIONS += $(ERF_MOISTURE_NULL_DIR)

ERF_MOISTURE_SAM_DIR = $(ERF_SOURCE_DIR)/Microphysics/SAM
include $(ERF_MOISTURE_SAM_DIR)/Make.package
VPATH_LOCATIONS += $(ERF_MOISTURE_SAM_DIR)
INCLUDE_LOCATIONS += $(ERF_MOISTURE_SAM_DIR)
endif

ifeq ($(USE_WARM_NO_PRECIP), TRUE)
Expand Down
2 changes: 2 additions & 0 deletions Exec/RegTests/WPS_Test/inputs_real_ChisholmView
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ erf.use_gravity = true
erf.use_terrain = true
erf.use_terrain = false

erf.moisture_model = "SAM"

erf.les_type = "None"
erf.molec_diff_type = "Constant"
erf.dynamicViscosity = 5.0
Expand Down
3 changes: 2 additions & 1 deletion Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ private:
amrex::Vector<amrex::MultiFab> rW_new;

#if defined(ERF_USE_MOISTURE)
Microphysics micro;
std::string moisture_model = "NullMoist";
Microphysics<NullMoist> micro;
amrex::Vector<amrex::MultiFab> qmoist; // This has 6 components: qv, qc, qi, qr, qs, qg
#endif

Expand Down
11 changes: 11 additions & 0 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,17 @@ ERF::ReadParameters ()
pp.query("use_tracer_particles", use_tracer_particles);
#endif

#ifdef ERF_USE_MOISTURE
// What type of moisture model to use
pp.query("moisture_model", moisture_model);
if (moisture_model == "SAM") {
SAM T;
micro.SetModel(T);
}

//micro.SetModel(moisture_model);
#endif

// If this is set, it must be even
if (fixed_mri_dt_ratio > 0 && (fixed_mri_dt_ratio%2 != 0) )
{
Expand Down
7 changes: 0 additions & 7 deletions Source/Microphysics/Make.package
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
CEXE_sources += Cloud.cpp
CEXE_sources += Init.cpp
CEXE_sources += Diagnose.cpp
CEXE_sources += Update.cpp
CEXE_sources += IceFall.cpp
CEXE_sources += Precip.cpp
CEXE_sources += PrecipFall.cpp
CEXE_headers += Microphysics.H

Loading

0 comments on commit e248a47

Please sign in to comment.