Skip to content

Commit

Permalink
Added RCEMIPII plane sst
Browse files Browse the repository at this point in the history
Surface condition dispatches on sfc_temp and model_config

Added buildkite test

add diagnostic variable

remove model_config
  • Loading branch information
cmschmitt519 committed Jul 2, 2024
1 parent 77d7f0b commit 396b1c7
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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`]"
Expand Down
30 changes: 30 additions & 0 deletions config/model_configs/rcemipii_box_diagnostic_edmfx.yml
Original file line number Diff line number Diff line change
@@ -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: 3600secs
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
2 changes: 1 addition & 1 deletion config/model_configs/rcemipii_sphere_diagnostic_edmfx.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
surface_setup: DefaultMoninObukhov
surface_temperature: RCEMIPIISphere
surface_temperature: RCEMIPII
rad: allskywithclear
turbconv: diagnostic_edmfx
implicit_diffusion: true
Expand Down
5 changes: 4 additions & 1 deletion post_processing/ci_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/solver/model_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/solver/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/surface_conditions/SurfaceConditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 34 additions & 10 deletions src/surface_conditions/surface_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -335,21 +329,51 @@ 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},
)
(; x) = coordinates
FT = eltype(x)
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
Expand Down

0 comments on commit 396b1c7

Please sign in to comment.