From ce2489bf858587078e1f763a4a6d5a3fda6bdce0 Mon Sep 17 00:00:00 2001 From: Cameron Schmitt Date: Fri, 28 Jun 2024 11:42:27 -0700 Subject: [PATCH] Added RCEMIPII plane sst Surface condition dispatches on sfc_temp and model_config Added buildkite test add diagnostic variable remove model_config --- .buildkite/pipeline.yml | 8 ++++ config/default_configs/default_config.yml | 2 +- .../rcemipii_box_diagnostic_edmfx.yml | 30 +++++++++++++ .../rcemipii_sphere_diagnostic_edmfx.yml | 2 +- post_processing/ci_plots.jl | 5 ++- src/solver/model_getters.jl | 6 +-- src/solver/types.jl | 2 +- src/surface_conditions/SurfaceConditions.jl | 2 +- src/surface_conditions/surface_conditions.jl | 42 ++++++++++++++----- 9 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 config/model_configs/rcemipii_box_diagnostic_edmfx.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e7b9861a09b..695bab356ad 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -158,6 +158,14 @@ steps: --job_id box_density_current_test artifact_paths: "box_density_current_test/output_active/*" + - label: ":computer: Box (ρe_tot) rcemipii with diagnostic edmf" + command: > + julia --color=yes --project=examples examples/hybrid/driver.jl + --config_file $CONFIG_PATH/rcemipii_box_diagnostic_edmfx.yml + --job_id rcemipii_box_diagnostic_edmfx + artifact_paths: "rcemipii_box_diagnostic_edmfx/output_active/*" + soft_fail: true + - group: "Plane Examples" steps: - label: ":computer: Agnesi linear hydrostatic mountain experiment (uniform)" diff --git a/config/default_configs/default_config.yml b/config/default_configs/default_config.yml index fdf240ace3e..e506115d3c0 100644 --- a/config/default_configs/default_config.yml +++ b/config/default_configs/default_config.yml @@ -176,7 +176,7 @@ surface_setup: help: "Surface flux scheme [`DefaultExchangeCoefficients` (default), `DefaultMoninObukhov`]" value: "DefaultExchangeCoefficients" surface_temperature: - help: "Prescribed surface temperature functional form ['ZonallySymmetric' (default), 'ZonallyAsymmetric']" + help: "Prescribed surface temperature functional form ['ZonallySymmetric' (default), 'ZonallyAsymmetric', 'RCEMIPII']" value: "ZonallySymmetric" initial_condition: help: "Initial condition [`DryBaroclinicWave`, `MoistBaroclinicWave`, `DecayingProfile`, `IsothermalProfile`, `Bomex`, `DryDensityCurrentProfile`, `AgnesiHProfile`, `ScharProfile`, `RisingThermalBubbleProfile`]" diff --git a/config/model_configs/rcemipii_box_diagnostic_edmfx.yml b/config/model_configs/rcemipii_box_diagnostic_edmfx.yml new file mode 100644 index 00000000000..e5e01cb3f9a --- /dev/null +++ b/config/model_configs/rcemipii_box_diagnostic_edmfx.yml @@ -0,0 +1,30 @@ +surface_setup: DefaultMoninObukhov +surface_temperature: RCEMIPII +insolation: rcemipii +config: box +rad: allskywithclear +turbconv: diagnostic_edmfx +implicit_diffusion: true +approximate_linear_solve_iters: 2 +prognostic_tke: true +edmfx_upwinding: first_order +edmfx_entr_model: "Generalized" +edmfx_detr_model: "Generalized" +edmfx_nh_pressure: true +edmfx_sgs_mass_flux: true +edmfx_sgs_diffusive_flux: true +moist: equil +precip_model: 0M +override_τ_precip: false +dt: 30secs +t_end: 600secs +dt_save_state_to_disk: 12hours +toml: [toml/diagnostic_edmfx_0M.toml] +netcdf_interpolation_num_points: [8, 8, 60] +netcdf_output_at_levels: true +diagnostics: + - short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl, pr] + period: 5mins + - short_name: [arup, waup, taup, thetaaup, haup, husup, hurup, clwup, cliup, waen, tke, lmix] + period: 5mins +ode_algo: ARS343 diff --git a/config/model_configs/rcemipii_sphere_diagnostic_edmfx.yml b/config/model_configs/rcemipii_sphere_diagnostic_edmfx.yml index fb234e9a3fb..4ef50bed1b4 100644 --- a/config/model_configs/rcemipii_sphere_diagnostic_edmfx.yml +++ b/config/model_configs/rcemipii_sphere_diagnostic_edmfx.yml @@ -1,5 +1,5 @@ surface_setup: DefaultMoninObukhov -surface_temperature: RCEMIPIISphere +surface_temperature: RCEMIPII rad: allskywithclear turbconv: diagnostic_edmfx implicit_diffusion: true diff --git a/post_processing/ci_plots.jl b/post_processing/ci_plots.jl index a98493a5a7c..faef78e4f86 100644 --- a/post_processing/ci_plots.jl +++ b/post_processing/ci_plots.jl @@ -1080,6 +1080,7 @@ EDMFBoxPlots = Union{ Val{:prognostic_edmfx_simpleplume_column}, Val{:prognostic_edmfx_gcmdriven_column}, Val{:prognostic_edmfx_bomex_box}, + Val{:rcemipii_box_diagnostic_edmfx}, } EDMFBoxPlotsWithPrecip = Union{ @@ -1204,7 +1205,9 @@ function make_plots( short_name = short_names[1], reduction, ) - if "10m" in available_periods + if "5m" in available_periods + period = "5m" + elseif "10m" in available_periods period = "10m" elseif "30m" in available_periods period = "30m" diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index 7faf2042ffb..9af233db85f 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -37,13 +37,13 @@ end function get_sfc_temperature_form(parsed_args) surface_temperature = parsed_args["surface_temperature"] @assert surface_temperature in - ("ZonallyAsymmetric", "ZonallySymmetric", "RCEMIPIISphere") + ("ZonallyAsymmetric", "ZonallySymmetric", "RCEMIPII") return if surface_temperature == "ZonallyAsymmetric" ZonallyAsymmetricSST() elseif surface_temperature == "ZonallySymmetric" ZonallySymmetricSST() - elseif surface_temperature == "RCEMIPIISphere" - RCEMIPIISphereSST() + elseif surface_temperature == "RCEMIPII" + RCEMIPIISST() end end diff --git a/src/solver/types.jl b/src/solver/types.jl index fe18df1fbd3..aabe904f6ae 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -26,7 +26,7 @@ struct PlaneModel <: AbstractModelConfig end abstract type AbstractSST end struct ZonallySymmetricSST <: AbstractSST end struct ZonallyAsymmetricSST <: AbstractSST end -struct RCEMIPIISphereSST <: AbstractSST end +struct RCEMIPIISST <: AbstractSST end abstract type AbstractInsolation end struct IdealizedInsolation <: AbstractInsolation end diff --git a/src/surface_conditions/SurfaceConditions.jl b/src/surface_conditions/SurfaceConditions.jl index 014368a15fb..d97711801b4 100644 --- a/src/surface_conditions/SurfaceConditions.jl +++ b/src/surface_conditions/SurfaceConditions.jl @@ -5,7 +5,7 @@ import ..Parameters as CAP import ..DryModel import ..ZonallyAsymmetricSST import ..ZonallySymmetricSST -import ..RCEMIPIISphereSST +import ..RCEMIPIISST import ..PrognosticSurfaceTemperature import ..PrescribedSurfaceTemperature import ..gcm_driven_timeseries diff --git a/src/surface_conditions/surface_conditions.jl b/src/surface_conditions/surface_conditions.jl index 9c18eefaeb8..413f5445995 100644 --- a/src/surface_conditions/surface_conditions.jl +++ b/src/surface_conditions/surface_conditions.jl @@ -168,14 +168,8 @@ function surface_state_to_conditions( error("surface q_vap cannot be specified when using a DryModel") T = if isnothing(sfc_prognostic_temp) - if isnothing(surf_state.T) && ( - coordinates isa Geometry.LatLongZPoint || - coordinates isa Geometry.LatLongPoint - ) + if isnothing(surf_state.T) surface_temperature(atmos.sfc_temperature, coordinates) - elseif isnothing(surf_state.T) - # Assume that the latitude is 0. - FT(300) else surf_state.T end @@ -335,21 +329,49 @@ function surface_state_to_conditions( end #Sphere SST distribution from Wing et al. (2023) https://gmd.copernicus.org/preprints/gmd-2023-235/ -function surface_temperature(::RCEMIPIISphereSST, coordinates) +function surface_temperature( + ::RCEMIPIISST, + coordinates::Union{Geometry.LatLongZPoint, Geometry.LatLongPoint}, +) (; lat) = coordinates FT = eltype(lat) T = FT(300) + FT(1.25) / 2 * cosd(360 * lat / 54) return T end -function surface_temperature(::ZonallySymmetricSST, coordinates) +#Plane SST distribution from Wing et al. (2023) https://gmd.copernicus.org/preprints/gmd-2023-235/ +function surface_temperature( + ::RCEMIPIISST, + coordinates::Union{Geometry.XYPoint, Geometry.XYZPoint}, +) + (; x) = coordinates + FT = eltype(x) + T = FT(300) + FT(1.25) / 2 * cos(2 * FT(pi) * x / 6000) + return T +end + +#For non-RCEMIPII box models with prescribed surface temp, assume that the latitude is 0. +function surface_temperature( + ::Union{ZonallySymmetricSST, ZonallyAsymmetricSST}, + ::Union{Geometry.XYPoint, Geometry.XYZPoint}, +) + return FT(300) +end + +function surface_temperature( + ::ZonallySymmetricSST, + coordinates::Geometry.LatLongZPoint, +) (; lat, z) = coordinates FT = eltype(lat) T = FT(271) + FT(29) * exp(-coordinates.lat^2 / (2 * 26^2)) - FT(6.5e-3) * z return T end -function surface_temperature(::ZonallyAsymmetricSST, coordinates) +function surface_temperature( + ::ZonallyAsymmetricSST, + coordinates::Geometry.LatLongZPoint, +) (; lat, long, z) = coordinates FT = eltype(lat) #Assume a surface temperature that varies with both longitude and latitude, Neale and Hoskins, 2021