From 8bb90c189941d0c5cfc3eb792a22410fbb61e6b3 Mon Sep 17 00:00:00 2001 From: Walter Hannah Date: Tue, 27 Feb 2024 08:15:16 -0800 Subject: [PATCH] Allow coupler options with spam_ prefix to override default values for specific parameters --- dynamics/spam/src/core/params.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dynamics/spam/src/core/params.h b/dynamics/spam/src/core/params.h index 2a076bc6..c8fb47d4 100644 --- a/dynamics/spam/src/core/params.h +++ b/dynamics/spam/src/core/params.h @@ -125,6 +125,26 @@ void read_params_coupler(Parameters ¶ms, Parallel &par, params.crm_per_phys = 1; } + // Allow coupler options to override defaults + if (coupler.option_exists("spam_couple_wind_exact_inverse")) { + params.couple_wind_exact_inverse = coupler.get_option("spam_couple_wind_exact_inverse"); + } + if (coupler.option_exists("spam_clip_negative_densities")) { + params.clip_negative_densities = coupler.get_option("spam_clip_negative_densities"); + } + if (coupler.option_exists("spam_clip_vertical_velocities")) { + params.clip_vertical_velocities = coupler.get_option("spam_clip_vertical_velocities"); + } + if (coupler.option_exists("spam_adjust_crm_per_phys_using_vert_cfl")) { + params.adjust_crm_per_phys_using_vert_cfl = coupler.get_option("spam_adjust_crm_per_phys_using_vert_cfl"); + } + if (coupler.option_exists("spam_target_cfl")) { + params.target_cfl = coupler.get_option("spam_target_cfl"); + } + if (coupler.option_exists("spam_max_w")) { + params.max_w = coupler.get_option("spam_max_w"); + } + #ifdef PAMC_MAN params.tstype = "ssprk3"; #else