From 0ea42fd69a312536bdb246c4192f2a6f3f20e98c Mon Sep 17 00:00:00 2001 From: "Aaron M. Lattanzi" <103702284+AMLattanzi@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:58:46 -0800 Subject: [PATCH] Fix when we test moisture model and instantiate. (#1342) --- Source/ERF.cpp | 30 +++++++++++--------- Source/Microphysics/Kessler/Init_Kessler.cpp | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/ERF.cpp b/Source/ERF.cpp index 4bd5a6aff..8df292a95 100644 --- a/Source/ERF.cpp +++ b/Source/ERF.cpp @@ -961,20 +961,6 @@ ERF::ReadParameters () particleData.init_particle_params(); #endif - // What type of moisture model to use - if (solverChoice.moisture_type == MoistureType::SAM) { - micro.SetModel(); - } else if (solverChoice.moisture_type == MoistureType::Kessler) { - micro.SetModel(); - } else if (solverChoice.moisture_type == MoistureType::FastEddy) { - micro.SetModel(); - } else if (solverChoice.moisture_type == MoistureType::None) { - micro.SetModel(); - amrex::Print() << "WARNING: Compiled with moisture but using NullMoist model!\n"; - } else { - amrex::Abort("Dont know this moisture_type!") ; - } - // If this is set, it must be even if (fixed_mri_dt_ratio > 0 && (fixed_mri_dt_ratio%2 != 0) ) { @@ -1129,6 +1115,22 @@ ERF::ReadParameters () #endif solverChoice.init_params(max_level); + + // What type of moisture model to use + // NOTE: Must be checked after init_params + if (solverChoice.moisture_type == MoistureType::SAM) { + micro.SetModel(); + } else if (solverChoice.moisture_type == MoistureType::Kessler) { + micro.SetModel(); + } else if (solverChoice.moisture_type == MoistureType::FastEddy) { + micro.SetModel(); + } else if (solverChoice.moisture_type == MoistureType::None) { + micro.SetModel(); + amrex::Print() << "WARNING: Compiled with moisture but using NullMoist model!\n"; + } else { + amrex::Abort("Dont know this moisture_type!") ; + } + if (verbose > 0) { solverChoice.display(); } diff --git a/Source/Microphysics/Kessler/Init_Kessler.cpp b/Source/Microphysics/Kessler/Init_Kessler.cpp index fcf469a2a..3c96dac8b 100644 --- a/Source/Microphysics/Kessler/Init_Kessler.cpp +++ b/Source/Microphysics/Kessler/Init_Kessler.cpp @@ -181,7 +181,7 @@ void Kessler::Init (const MultiFab& cons_in, }); // This fills qv - //Diagnose(); + Diagnose(); #if 0 amrex::ParallelFor( box3d, [=] AMREX_GPU_DEVICE (int k, int j, int i)