From d400692a481fe81292b9156e58a10ef18b2e02b0 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Fri, 25 Aug 2023 11:45:22 -0700 Subject: [PATCH] Remove params from config, add TOMLs for overrides --- config/default_configs/default_config.yml | 20 +----------------- ...y_highres_hightop_rayleigh35e3_float64.yml | 3 +-- .../longrun_compressible_edmf_trmm.yml | 5 ++--- .../longrun_hs_rhoe_dry_nz63_55km_rs35km.yml | 2 +- ...quilmoist_highres_hightop_rayleigh30e3.yml | 3 +-- ...hs_rhoe_equilmoist_nz64_0M_55km_rs35km.yml | 3 +-- config/model_configs/bomex_box_rhoe.yml | 2 +- config/model_configs/edmf_trmm.yml | 2 +- config/model_configs/edmfx_bomex_box_v1.yml | 2 +- config/model_configs/edmfx_bomex_box_v2.yml | 2 +- .../plane_agnesi_mountain_test_stretched.yml | 2 +- .../plane_agnesi_mountain_test_uniform.yml | 2 +- .../plane_schar_mountain_test_stretched.yml | 2 +- .../plane_schar_mountain_test_uniform.yml | 2 +- ...lmoist_allsky_gw_raw_zonallyasymmetric.yml | 2 +- ...uaplanet_rhoe_equilmoist_allsky_gw_res.yml | 2 +- ..._suarez_rhoe_equilmoist_hightop_sponge.yml | 3 +-- ..._suarez_rhoe_equilmoist_hightop_sponge.yml | 3 +-- config/perf_configs/flame/perf_gw.yml | 2 +- src/parameters/Parameters.jl | 17 ++++++++++++++- src/parameters/create_parameters.jl | 16 +++++++++++--- src/solver/model_getters.jl | 21 ++++++++----------- src/solver/type_getters.jl | 13 ++++++------ toml/bomex_box_rhoe.toml | 5 +++++ toml/edmf_trmm.toml | 5 +++++ toml/edmfx_bomex_box_v1.toml | 5 +++++ toml/edmfx_bomex_box_v2.toml | 5 +++++ toml/flame_perf_gw.toml | 4 ++++ ..._highres_hightop_rayleigh35e3_float64.toml | 10 +++++++++ toml/longrun_compressible_edmf_trmm.toml | 5 +++++ .../longrun_hs_rhoe_dry_nz63_55km_rs35km.toml | 5 +++++ ...uilmoist_highres_hightop_rayleigh30e3.toml | 10 +++++++++ ...s_rhoe_equilmoist_nz64_0M_55km_rs35km.toml | 10 +++++++++ .../plane_agnesi_mountain_test_stretched.toml | 5 +++++ toml/plane_agnesi_mountain_test_uniform.toml | 5 +++++ toml/plane_schar_mountain_test_stretched.toml | 5 +++++ toml/plane_schar_mountain_test_uniform.toml | 5 +++++ ...moist_allsky_gw_raw_zonallyasymmetric.toml | 5 +++++ ...aplanet_rhoe_equilmoist_allsky_gw_res.toml | 5 +++++ ...suarez_rhoe_equilmoist_hightop_sponge.toml | 10 +++++++++ ...suarez_rhoe_equilmoist_hightop_sponge.toml | 10 +++++++++ 41 files changed, 179 insertions(+), 66 deletions(-) create mode 100644 toml/bomex_box_rhoe.toml create mode 100644 toml/edmf_trmm.toml create mode 100644 toml/edmfx_bomex_box_v1.toml create mode 100644 toml/edmfx_bomex_box_v2.toml create mode 100644 toml/flame_perf_gw.toml create mode 100644 toml/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.toml create mode 100644 toml/longrun_compressible_edmf_trmm.toml create mode 100644 toml/longrun_hs_rhoe_dry_nz63_55km_rs35km.toml create mode 100644 toml/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.toml create mode 100644 toml/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.toml create mode 100644 toml/plane_agnesi_mountain_test_stretched.toml create mode 100644 toml/plane_agnesi_mountain_test_uniform.toml create mode 100644 toml/plane_schar_mountain_test_stretched.toml create mode 100644 toml/plane_schar_mountain_test_uniform.toml create mode 100644 toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.toml create mode 100644 toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.toml create mode 100644 toml/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.toml create mode 100644 toml/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.toml diff --git a/config/default_configs/default_config.yml b/config/default_configs/default_config.yml index d41abfafe3..637ff26b79 100644 --- a/config/default_configs/default_config.yml +++ b/config/default_configs/default_config.yml @@ -243,22 +243,4 @@ prognostic_tke: prognostic_surface: help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `PrognosticSurfaceTemperature`, `PrescribedSurfaceTemperature`]" value: "false" -# Will be moved to ClimaParameters.jl -C_E: - help: "Bulk transfer coefficient" - value: 0.0044 -alpha_rayleigh_w: - help: "Rayleigh sponge coefficient for vertical velocity" - value: 1.0 -alpha_rayleigh_uh: - help: "Rayleigh sponge coefficient for horizontal velocity" - value: 0.0 -zd_viscous: - help: "Viscous sponge height" - value: 15000.0 -zd_rayleigh: - help: "Rayleigh sponge height" - value: 15000.0 -kappa_2_sponge: - help: "Viscous sponge coefficient" - value: 1.0e6 + \ No newline at end of file diff --git a/config/longrun_configs/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.yml b/config/longrun_configs/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.yml index 5d22c99568..56fa1b5d6d 100644 --- a/config/longrun_configs/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.yml +++ b/config/longrun_configs/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.yml @@ -1,7 +1,6 @@ rad: "clearsky" dt_save_to_disk: "10days" rayleigh_sponge: true -zd_rayleigh: 35000.0 z_elem: 50 dt: "150secs" surface_setup: "DefaultMoninObukhov" @@ -11,9 +10,9 @@ dz_bottom: 30.0 vert_diff: "true" h_elem: 16 kappa_4: 1.0e16 -alpha_rayleigh_w: 10.0 FLOAT_TYPE: "Float64" z_max: 45000.0 precip_model: "0M" job_id: "longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64" moist: "equil" +toml: toml/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.toml \ No newline at end of file diff --git a/config/longrun_configs/longrun_compressible_edmf_trmm.yml b/config/longrun_configs/longrun_compressible_edmf_trmm.yml index 0d858773ee..24724c94ee 100644 --- a/config/longrun_configs/longrun_compressible_edmf_trmm.yml +++ b/config/longrun_configs/longrun_compressible_edmf_trmm.yml @@ -1,4 +1,3 @@ - config: "column" FLOAT_TYPE: "Float64" hyperdiff: "false" @@ -12,7 +11,7 @@ z_elem: 90 z_stretch: false z_max: 17000 rayleigh_sponge: true -zd_rayleigh: 15000 job_id: "longrun_compressible_edmf_trmm" dt: "0.2secs" -t_end: "3.8hours" \ No newline at end of file +t_end: "3.8hours" +toml: longrun_compressible_edmf_trmm.toml diff --git a/config/longrun_configs/longrun_hs_rhoe_dry_nz63_55km_rs35km.yml b/config/longrun_configs/longrun_hs_rhoe_dry_nz63_55km_rs35km.yml index 7fc5a161e1..f66bf6cdee 100644 --- a/config/longrun_configs/longrun_hs_rhoe_dry_nz63_55km_rs35km.yml +++ b/config/longrun_configs/longrun_hs_rhoe_dry_nz63_55km_rs35km.yml @@ -9,5 +9,5 @@ kappa_4: 1.0e16 forcing: "held_suarez" dt: "300secs" rayleigh_sponge: true -zd_rayleigh: 35000.0 job_id: "longrun_hs_rhoe_equilmoist_nz63_0M_55km_rs35km" +toml: toml/longrun_hs_rhoe_equilmoist_nz63_0M_55km_rs35km.toml diff --git a/config/longrun_configs/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.yml b/config/longrun_configs/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.yml index 0b6c1c8437..6dc6372066 100644 --- a/config/longrun_configs/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.yml +++ b/config/longrun_configs/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.yml @@ -1,6 +1,5 @@ dt_save_to_disk: "10days" rayleigh_sponge: true -zd_rayleigh: 30000.0 z_elem: 50 dt: "150secs" t_end: "300days" @@ -10,8 +9,8 @@ vert_diff: "true" h_elem: 16 kappa_4: 1.0e16 forcing: "held_suarez" -alpha_rayleigh_w: 10.0 z_max: 45000.0 precip_model: "0M" job_id: "longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3" moist: "equil" +toml: toml/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.toml diff --git a/config/longrun_configs/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.yml b/config/longrun_configs/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.yml index 215c75e48a..767564ba05 100644 --- a/config/longrun_configs/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.yml +++ b/config/longrun_configs/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.yml @@ -11,7 +11,6 @@ vert_diff: "true" moist: "equil" precip_model: "0M" rayleigh_sponge: true -alpha_rayleigh_w: 10.0 -zd_rayleigh: 35000.0 forcing: "held_suarez" job_id: "longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km" +toml: toml/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.toml diff --git a/config/model_configs/bomex_box_rhoe.yml b/config/model_configs/bomex_box_rhoe.yml index cd522c6bc2..b5cc52b9c3 100644 --- a/config/model_configs/bomex_box_rhoe.yml +++ b/config/model_configs/bomex_box_rhoe.yml @@ -7,7 +7,6 @@ dt: "0.5secs" surface_setup: "Bomex" perturb_initstate: false t_end: "600secs" -C_E: 0.044 y_max: 10000.0 z_stretch: false vert_diff: "true" @@ -17,3 +16,4 @@ z_max: 3000.0 ls_adv: "Bomex" job_id: "bomex_box_rhoe" moist: "equil" +toml: toml/bomex_box_rhoe.toml \ No newline at end of file diff --git a/config/model_configs/edmf_trmm.yml b/config/model_configs/edmf_trmm.yml index ac278104c4..5a0ba25a4b 100644 --- a/config/model_configs/edmf_trmm.yml +++ b/config/model_configs/edmf_trmm.yml @@ -15,7 +15,7 @@ FLOAT_TYPE: "Float64" z_max: 16400.0 precip_model: "1M" regression_test: true -alpha_rayleigh_uh: 0.0001 dt_save_to_sol: "5mins" job_id: "edmf_trmm" rad: "TRMM_LBA" +toml: toml/edmf_trmm.toml diff --git a/config/model_configs/edmfx_bomex_box_v1.yml b/config/model_configs/edmfx_bomex_box_v1.yml index a00528c85a..def996c80c 100644 --- a/config/model_configs/edmfx_bomex_box_v1.yml +++ b/config/model_configs/edmfx_bomex_box_v1.yml @@ -10,7 +10,6 @@ surface_setup: "Bomex" perturb_initstate: false edmfx_entr_detr: true t_end: "10800secs" -C_E: 0.044 y_max: 100000.0 y_elem: 2 turbconv: "edmfx" @@ -24,3 +23,4 @@ z_max: 3000.0 ls_adv: "Bomex" job_id: "edmfx_bomex_box_v1" moist: "equil" +toml: toml/edmfx_bomex_box_v1.toml diff --git a/config/model_configs/edmfx_bomex_box_v2.yml b/config/model_configs/edmfx_bomex_box_v2.yml index fababeec1c..08a0a58d5d 100644 --- a/config/model_configs/edmfx_bomex_box_v2.yml +++ b/config/model_configs/edmfx_bomex_box_v2.yml @@ -10,7 +10,6 @@ surface_setup: "Bomex" perturb_initstate: false edmfx_entr_detr: true t_end: "10800secs" -C_E: 0.044 y_max: 100000.0 y_elem: 2 turbconv: "edmfx" @@ -25,3 +24,4 @@ z_max: 3000.0 ls_adv: "Bomex" job_id: "edmfx_bomex_box_v2" moist: "equil" +toml: toml/edmfx_bomex_box_v2.toml \ No newline at end of file diff --git a/config/model_configs/plane_agnesi_mountain_test_stretched.yml b/config/model_configs/plane_agnesi_mountain_test_stretched.yml index 6f908628c4..28a8992de1 100644 --- a/config/model_configs/plane_agnesi_mountain_test_stretched.yml +++ b/config/model_configs/plane_agnesi_mountain_test_stretched.yml @@ -11,7 +11,7 @@ dz_bottom: 200.0 use_reference_state: false config: "plane" kappa_4: 1.0e6 -alpha_rayleigh_w: 0.1 z_max: 25000.0 topography: "Agnesi" job_id: "plane_agnesi_mountain_test_stretched" +toml: toml/plane_agnesi_mountain_test_stretched.toml \ No newline at end of file diff --git a/config/model_configs/plane_agnesi_mountain_test_uniform.yml b/config/model_configs/plane_agnesi_mountain_test_uniform.yml index bb6e0ff504..7da1a214c4 100644 --- a/config/model_configs/plane_agnesi_mountain_test_uniform.yml +++ b/config/model_configs/plane_agnesi_mountain_test_uniform.yml @@ -10,7 +10,7 @@ x_elem: 80 use_reference_state: false config: "plane" kappa_4: 1.0e6 -alpha_rayleigh_w: 0.1 z_max: 25000.0 topography: "Agnesi" job_id: "plane_agnesi_mountain_test_uniform" +toml: toml/plane_agnesi_mountain_test_uniform.toml \ No newline at end of file diff --git a/config/model_configs/plane_schar_mountain_test_stretched.yml b/config/model_configs/plane_schar_mountain_test_stretched.yml index 1e6890b6f4..9c8aac55ef 100644 --- a/config/model_configs/plane_schar_mountain_test_stretched.yml +++ b/config/model_configs/plane_schar_mountain_test_stretched.yml @@ -12,7 +12,7 @@ use_reference_state: false ode_algo: "SSP33ShuOsher" config: "plane" kappa_4: 5.0e7 -alpha_rayleigh_w: 0.1 z_max: 25000.0 topography: "Schar" job_id: "plane_schar_mountain_test_stretched" +toml: toml/plane_schar_mountain_test_stretched.toml \ No newline at end of file diff --git a/config/model_configs/plane_schar_mountain_test_uniform.yml b/config/model_configs/plane_schar_mountain_test_uniform.yml index f627e30234..c733c5faf9 100644 --- a/config/model_configs/plane_schar_mountain_test_uniform.yml +++ b/config/model_configs/plane_schar_mountain_test_uniform.yml @@ -11,7 +11,7 @@ use_reference_state: false ode_algo: "SSP33ShuOsher" config: "plane" kappa_4: 5.0e7 -alpha_rayleigh_w: 0.1 z_max: 25000.0 topography: "Schar" job_id: "plane_schar_mountain_test_uniform" +toml: toml/plane_schar_mountain_test_uniform.toml diff --git a/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml b/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml index 2ac2bb11bf..3dc1334ddb 100644 --- a/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml +++ b/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml @@ -1,7 +1,6 @@ rad: "allskywithclear" dt_save_to_disk: "18hours" rayleigh_sponge: true -zd_rayleigh: 30000.0 orographic_gravity_wave: "raw_topo" z_elem: 25 dt: "400secs" @@ -17,3 +16,4 @@ regression_test: true surface_temperature: "ZonallyAsymmetric" job_id: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric" moist: "equil" +toml: toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.toml diff --git a/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml b/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml index d1a07a1db0..35433e6d8c 100644 --- a/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml +++ b/config/model_configs/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml @@ -1,7 +1,6 @@ rad: "allskywithclear" dt_save_to_disk: "18hours" rayleigh_sponge: true -zd_rayleigh: 30000.0 orographic_gravity_wave: "gfdl_restart" z_elem: 25 dt: "400secs" @@ -16,3 +15,4 @@ precip_model: "0M" regression_test: true job_id: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res" moist: "equil" +toml: toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.toml \ No newline at end of file diff --git a/config/model_configs/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml b/config/model_configs/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml index 5c8defe792..23fb2c682d 100644 --- a/config/model_configs/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml +++ b/config/model_configs/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml @@ -1,7 +1,5 @@ dt_save_to_disk: "4days" rayleigh_sponge: true -zd_rayleigh: 30000.0 -zd_viscous: 30000.0 dt: "450secs" z_elem: 25 t_end: "4days" @@ -14,3 +12,4 @@ regression_test: true viscous_sponge: true job_id: "sphere_held_suarez_rhoe_equilmoist_hightop_sponge" moist: "equil" +toml: toml/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.toml \ No newline at end of file diff --git a/config/model_configs/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.yml b/config/model_configs/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.yml index 15e9ca8206..dcde953af7 100644 --- a/config/model_configs/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.yml +++ b/config/model_configs/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.yml @@ -1,7 +1,5 @@ dt_save_to_disk: "3days" rayleigh_sponge: true -zd_rayleigh: 30000.0 -zd_viscous: 30000.0 dt: "300secs" z_elem: 25 tracer_upwinding: first_order @@ -17,3 +15,4 @@ viscous_sponge: true job_id: "sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge" moist: "equil" apply_limiter: true +toml: toml/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.toml \ No newline at end of file diff --git a/config/perf_configs/flame/perf_gw.yml b/config/perf_configs/flame/perf_gw.yml index ccfe571f29..5a34a1ae64 100644 --- a/config/perf_configs/flame/perf_gw.yml +++ b/config/perf_configs/flame/perf_gw.yml @@ -1,6 +1,5 @@ rad: "allskywithclear" rayleigh_sponge: true -zd_rayleigh: 30000.0 orographic_gravity_wave: "raw_topo" z_elem: 25 dt: "1secs" @@ -14,3 +13,4 @@ z_max: 45000.0 precip_model: "0M" job_id: "flame_perf_gw" moist: "equil" +toml: toml/flame_perf_gw.toml \ No newline at end of file diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index 26b5234410..b5838bc0a7 100644 --- a/src/parameters/Parameters.jl +++ b/src/parameters/Parameters.jl @@ -10,7 +10,7 @@ const ACAP = AbstractClimaAtmosParameters Base.broadcastable(param_set::ACAP) = tuple(param_set) -Base.@kwdef struct ClimaAtmosParameters{FT, TP, RP, IP, MPP, SFP, TCP} <: ACAP +Base.@kwdef struct ClimaAtmosParameters{FT, TP, RP, IP, MPP, SFP, TCP, SP} <: ACAP Omega::FT f_plane_coriolis_frequency::FT planet_radius::FT @@ -26,11 +26,26 @@ Base.@kwdef struct ClimaAtmosParameters{FT, TP, RP, IP, MPP, SFP, TCP} <: ACAP microphysics_params::MPP surfacefluxes_params::SFP turbconv_params::TCP + sponge_params::SP entr_coeff::FT = 1 detr_coeff::FT = 0.001 # TODO: Figure out a better place for these held-suarez parameters ΔT_y_dry::FT ΔT_y_wet::FT + C_E::FT +end + +""" + SpongeParameters{FT} + +Parameters for both the viscous and rayleigh sponge. +""" +Base.@kwdef struct SpongeParameters{FT} + alpha_rayleigh_w::FT + alpha_rayleigh_uh::FT + zd_viscous::FT + zd_rayleigh::FT + kappa_2_sponge::FT end Base.eltype(::ClimaAtmosParameters{FT}) where {FT} = FT diff --git a/src/parameters/create_parameters.jl b/src/parameters/create_parameters.jl index 79331f6f40..b1bfee588c 100644 --- a/src/parameters/create_parameters.jl +++ b/src/parameters/create_parameters.jl @@ -38,6 +38,7 @@ function create_climaatmos_parameter_set( aliases = setdiff(aliases, ["thermo_params"]) pairs = CP.get_parameter_values!(toml_dict, aliases, "CloudMicrophysics") pairs = override_climaatmos_defaults((; pairs...), overrides) + microphys_params = CM.Parameters.CloudMicrophysicsParameters{FTD, TP}(; pairs..., thermo_params, @@ -98,7 +99,13 @@ function create_climaatmos_parameter_set( pairs = CP.get_parameter_values!( toml_dict, - ["Omega", "planet_radius", "astro_unit", "ΔT_y_dry", "ΔT_y_wet"], + ["alpha_rayleigh_w", "alpha_rayleigh_uh", "zd_viscous", "zd_rayleigh", "kappa_2_sponge"], + ) + sponge_params = CAP.SpongeParameters(; pairs...) + + pairs = CP.get_parameter_values!( + toml_dict, + ["Omega", "planet_radius", "astro_unit", "ΔT_y_dry", "ΔT_y_wet", "C_E"], "ClimaAtmos", ) pairs = (; pairs...) # convert to NamedTuple @@ -121,8 +128,10 @@ function create_climaatmos_parameter_set( turbconv_params = tc_params, entr_coeff = FTD(parsed_args["entr_coeff"]), detr_coeff = FTD(parsed_args["detr_coeff"]), - ΔT_y_dry = FTD(pairs.ΔT_y_dry), - ΔT_y_wet = FTD(pairs.ΔT_y_wet), + ΔT_y_dry = pairs.ΔT_y_dry, + ΔT_y_wet = pairs.ΔT_y_wet, + C_E = pairs.C_E, + sponge_params ) # logfilepath = joinpath(@__DIR__, "logfilepath_$FT.toml") # CP.log_parameter_information(toml_dict, logfilepath) @@ -134,6 +143,7 @@ function create_parameter_set(config::AtmosConfig) (; toml_dict, parsed_args) = config FT = eltype(config) dt = FT(CA.time_to_seconds(parsed_args["dt"])) + return if CA.is_column_edmf(parsed_args) overrides = (; MSLP = 100000.0, τ_precip = dt) create_climaatmos_parameter_set(toml_dict, parsed_args, overrides) diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index 20d4449d8c..127dc95295 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -50,14 +50,14 @@ end function get_vertical_diffusion_model( diffuse_momentum, parsed_args, + params, ::Type{FT}, ) where {FT} vert_diff_name = parsed_args["vert_diff"] return if vert_diff_name in ("false", false, "none") nothing elseif vert_diff_name in ("true", true, "VerticalDiffusion") - C_E = FT(parsed_args["C_E"]) - VerticalDiffusion{diffuse_momentum, FT}(; C_E) + VerticalDiffusion{diffuse_momentum, FT}(; C_E = params.C_E) else error("Uncaught diffusion model `$vert_diff_name`.") end @@ -76,30 +76,27 @@ function get_surface_model(parsed_args) end end -function get_viscous_sponge_model(parsed_args, ::Type{FT}) where {FT} +function get_viscous_sponge_model(parsed_args, sponge_params, ::Type{FT}) where {FT} vs_name = parsed_args["viscous_sponge"] return if vs_name in ("false", false, "none") nothing elseif vs_name in ("true", true, "ViscousSponge") - zd = parsed_args["zd_viscous"] - κ₂ = parsed_args["kappa_2_sponge"] + zd = sponge_params.zd_viscous + κ₂ = sponge_params.kappa_2_sponge ViscousSponge{FT}(; zd, κ₂) else error("Uncaught viscous sponge model `$vs_name`.") end end -function get_rayleigh_sponge_model(parsed_args, ::Type{FT}) where {FT} +function get_rayleigh_sponge_model(parsed_args, sponge_params, ::Type{FT}) where {FT} rs_name = parsed_args["rayleigh_sponge"] return if rs_name in ("false", false) nothing elseif rs_name in ("true", true, "RayleighSponge") - zd = parsed_args["zd_rayleigh"] - α_uₕ = parsed_args["alpha_rayleigh_uh"] - α_w = parsed_args["alpha_rayleigh_w"] - isnothing(zd) && (zd = FT(15e3)) - isnothing(α_uₕ) && (α_uₕ = FT(1e-4)) - isnothing(α_w) && (α_w = FT(1)) + zd = sponge_params.zd_rayleigh + α_uₕ = sponge_params.alpha_rayleigh_uh + α_w = sponge_params.alpha_rayleigh_w RayleighSponge{FT}(; zd, α_uₕ, α_w) else error("Uncaught rayleigh sponge model `$rs_name`.") diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index 459dfc5758..2cb65cbb00 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -13,7 +13,8 @@ import OrdinaryDiffEq as ODE import ClimaTimeSteppers as CTS import DiffEqCallbacks as DEQ -function get_atmos(config::AtmosConfig, turbconv_params) +function get_atmos(config::AtmosConfig, params) + (; turbconv_params, sponge_params) = params (; parsed_args) = config FT = eltype(config) moisture_model = get_moisture_model(parsed_args) @@ -36,7 +37,7 @@ function get_atmos(config::AtmosConfig, turbconv_params) @assert edmfx_nh_pressure in (false, true) model_config = get_model_config(parsed_args) - vert_diff = get_vertical_diffusion_model(diffuse_momentum, parsed_args, FT) + vert_diff = get_vertical_diffusion_model(diffuse_momentum, parsed_args, params, FT) atmos = AtmosModel(; moisture_model, model_config, @@ -70,8 +71,8 @@ function get_atmos(config::AtmosConfig, turbconv_params) ), hyperdiff = get_hyperdiffusion_model(parsed_args, FT), vert_diff, - viscous_sponge = get_viscous_sponge_model(parsed_args, FT), - rayleigh_sponge = get_rayleigh_sponge_model(parsed_args, FT), + viscous_sponge = get_viscous_sponge_model(parsed_args, sponge_params, FT), + rayleigh_sponge = get_rayleigh_sponge_model(parsed_args, sponge_params, FT), sfc_temperature = get_sfc_temperature_form(parsed_args), surface_model = get_surface_model(parsed_args), ) @@ -686,9 +687,9 @@ function get_comms_context(parsed_args) end function get_integrator(config::AtmosConfig) - params = create_parameter_set(config) + params = CA.create_parameter_set(config) - atmos = get_atmos(config, params.turbconv_params) + atmos = get_atmos(config, params) numerics = get_numerics(config.parsed_args) simulation = get_simulation(config, config.comms_ctx) initial_condition = get_initial_condition(config.parsed_args) diff --git a/toml/bomex_box_rhoe.toml b/toml/bomex_box_rhoe.toml new file mode 100644 index 0000000000..d84c67e3b9 --- /dev/null +++ b/toml/bomex_box_rhoe.toml @@ -0,0 +1,5 @@ +[C_E] +alias = C_E +value = 0.044 +type = "float" + diff --git a/toml/edmf_trmm.toml b/toml/edmf_trmm.toml new file mode 100644 index 0000000000..e12c9b06ce --- /dev/null +++ b/toml/edmf_trmm.toml @@ -0,0 +1,5 @@ +[alpha_rayleigh_uh] +alias = alpha_rayleigh_uh +value = 0.0001 +type = "float" + diff --git a/toml/edmfx_bomex_box_v1.toml b/toml/edmfx_bomex_box_v1.toml new file mode 100644 index 0000000000..d84c67e3b9 --- /dev/null +++ b/toml/edmfx_bomex_box_v1.toml @@ -0,0 +1,5 @@ +[C_E] +alias = C_E +value = 0.044 +type = "float" + diff --git a/toml/edmfx_bomex_box_v2.toml b/toml/edmfx_bomex_box_v2.toml new file mode 100644 index 0000000000..d84c67e3b9 --- /dev/null +++ b/toml/edmfx_bomex_box_v2.toml @@ -0,0 +1,5 @@ +[C_E] +alias = C_E +value = 0.044 +type = "float" + diff --git a/toml/flame_perf_gw.toml b/toml/flame_perf_gw.toml new file mode 100644 index 0000000000..d177faa066 --- /dev/null +++ b/toml/flame_perf_gw.toml @@ -0,0 +1,4 @@ +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" diff --git a/toml/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.toml b/toml/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.toml new file mode 100644 index 0000000000..433506a3f5 --- /dev/null +++ b/toml/longrun_aquaplanet_rhoe_equil_clearsky_highres_hightop_rayleigh35e3_float64.toml @@ -0,0 +1,10 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 10.0 +type = "float" + +[zd_rayleigh] +alias = zd_rayleigh +value = 35000.0 +type = "float" + diff --git a/toml/longrun_compressible_edmf_trmm.toml b/toml/longrun_compressible_edmf_trmm.toml new file mode 100644 index 0000000000..1bd36d7c5e --- /dev/null +++ b/toml/longrun_compressible_edmf_trmm.toml @@ -0,0 +1,5 @@ +[zd_rayleigh] +alias = zd_rayleigh +value = 15000 +type = "float" + diff --git a/toml/longrun_hs_rhoe_dry_nz63_55km_rs35km.toml b/toml/longrun_hs_rhoe_dry_nz63_55km_rs35km.toml new file mode 100644 index 0000000000..72e7bc39c2 --- /dev/null +++ b/toml/longrun_hs_rhoe_dry_nz63_55km_rs35km.toml @@ -0,0 +1,5 @@ +[zd_rayleigh] +alias = zd_rayleigh +value = 35000.0 +type = "float" + diff --git a/toml/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.toml b/toml/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.toml new file mode 100644 index 0000000000..ad561195ad --- /dev/null +++ b/toml/longrun_hs_rhoe_equilmoist_highres_hightop_rayleigh30e3.toml @@ -0,0 +1,10 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 10.0 +type = "float" + +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" + diff --git a/toml/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.toml b/toml/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.toml new file mode 100644 index 0000000000..433506a3f5 --- /dev/null +++ b/toml/longrun_hs_rhoe_equilmoist_nz64_0M_55km_rs35km.toml @@ -0,0 +1,10 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 10.0 +type = "float" + +[zd_rayleigh] +alias = zd_rayleigh +value = 35000.0 +type = "float" + diff --git a/toml/plane_agnesi_mountain_test_stretched.toml b/toml/plane_agnesi_mountain_test_stretched.toml new file mode 100644 index 0000000000..b2b000a081 --- /dev/null +++ b/toml/plane_agnesi_mountain_test_stretched.toml @@ -0,0 +1,5 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 0.1 +type = "float" + diff --git a/toml/plane_agnesi_mountain_test_uniform.toml b/toml/plane_agnesi_mountain_test_uniform.toml new file mode 100644 index 0000000000..b2b000a081 --- /dev/null +++ b/toml/plane_agnesi_mountain_test_uniform.toml @@ -0,0 +1,5 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 0.1 +type = "float" + diff --git a/toml/plane_schar_mountain_test_stretched.toml b/toml/plane_schar_mountain_test_stretched.toml new file mode 100644 index 0000000000..b2b000a081 --- /dev/null +++ b/toml/plane_schar_mountain_test_stretched.toml @@ -0,0 +1,5 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 0.1 +type = "float" + diff --git a/toml/plane_schar_mountain_test_uniform.toml b/toml/plane_schar_mountain_test_uniform.toml new file mode 100644 index 0000000000..b2b000a081 --- /dev/null +++ b/toml/plane_schar_mountain_test_uniform.toml @@ -0,0 +1,5 @@ +[alpha_rayleigh_w] +alias = alpha_rayleigh_w +value = 0.1 +type = "float" + diff --git a/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.toml b/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.toml new file mode 100644 index 0000000000..2b001d6147 --- /dev/null +++ b/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.toml @@ -0,0 +1,5 @@ +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" + diff --git a/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.toml b/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.toml new file mode 100644 index 0000000000..2b001d6147 --- /dev/null +++ b/toml/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.toml @@ -0,0 +1,5 @@ +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" + diff --git a/toml/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.toml b/toml/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.toml new file mode 100644 index 0000000000..31198966ff --- /dev/null +++ b/toml/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.toml @@ -0,0 +1,10 @@ +[zd_viscous] +alias = zd_viscous +value = 30000.0 +type = "float" + +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" + diff --git a/toml/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.toml b/toml/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.toml new file mode 100644 index 0000000000..31198966ff --- /dev/null +++ b/toml/sphere_ssp_first_tracer_energy_upwind_held_suarez_rhoe_equilmoist_hightop_sponge.toml @@ -0,0 +1,10 @@ +[zd_viscous] +alias = zd_viscous +value = 30000.0 +type = "float" + +[zd_rayleigh] +alias = zd_rayleigh +value = 30000.0 +type = "float" +