diff --git a/.buildkite/longruns/pipeline.yml b/.buildkite/longruns/pipeline.yml index 7ee9dcc178..85c0122215 100644 --- a/.buildkite/longruns/pipeline.yml +++ b/.buildkite/longruns/pipeline.yml @@ -61,9 +61,22 @@ steps: artifact_paths: "$$JOB_NAME/*" agents: slurm_ntasks: 32 + slurm_nodes: 2 slurm_time: 24:00:00 env: JOB_NAME: "longrun_ssp_bw_rhoe_equil_highres" + + - label: ":computer: aquaplanet equilmoist clearsky radiation + prognostic edmf diffusion only + 0M microphysics" + command: + - srun julia --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/$$JOB_NAME.yml + artifact_paths: "$$JOB_NAME/*" + agents: + slurm_ntasks: 64 + slurm_nodes: 4 + slurm_mem_per_cpu: 16GB + slurm_time: 24:00:00 + env: + JOB_NAME: "longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_diffonly_0M" - group: "Low resolution long runs" diff --git a/config/default_configs/default_edmf_config.yml b/config/default_configs/default_edmf_config.yml index d796dff1f0..2a1399fdf0 100644 --- a/config/default_configs/default_edmf_config.yml +++ b/config/default_configs/default_edmf_config.yml @@ -5,9 +5,9 @@ turbconv: advection_test: help: "Switches off all grid-scale and subgrid-scale momentum tendencies [`false` (default), `true`]" value: false -gs_tendency: - help: "Turns on all grid-scale tendencies [`true` (default), `false`]" - value: true +zero_tendency: + help: "Turns off tendencies [`nothing` (default), `grid_scale`, `subgrid_scale`]" + value: ~ implicit_sgs_advection: help: "Whether to treat the subgrid-scale vertical advection tendency implicitly [`false` (default), `true`]" value: false diff --git a/config/longrun_configs/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_diffonly_0M.yml b/config/longrun_configs/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_diffonly_0M.yml new file mode 100644 index 0000000000..90ed3254c3 --- /dev/null +++ b/config/longrun_configs/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_diffonly_0M.yml @@ -0,0 +1,30 @@ +h_elem: 16 +z_max: 55000.0 +z_elem: 63 +dz_bottom: 30.0 +dz_top: 3000.0 +moist: "equil" +precip_model: "0M" +override_τ_precip: false +rad: "clearsky" +dt_rad: "6hours" +surface_setup: "DefaultMoninObukhov" +turbconv: "prognostic_edmfx" +implicit_diffusion: true +approximate_linear_solve_iters: 2 +max_newton_iters_ode: 3 +zero_tendency: "subgrid_scale" +prognostic_tke: true +edmfx_upwinding: "first_order" +edmfx_entr_model: "Generalized" +edmfx_detr_model: "Generalized" +edmfx_nh_pressure: false +edmfx_velocity_relaxation: true +edmfx_sgs_mass_flux: false +edmfx_sgs_diffusive_flux: true +rayleigh_sponge: true +dt_save_state_to_disk: "10days" +dt: "100secs" +t_end: "30days" +job_id: "longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_diffonly_0M" +toml: [toml/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_0M.toml] diff --git a/config/model_configs/prognostic_edmfx_simpleplume_column.yml b/config/model_configs/prognostic_edmfx_simpleplume_column.yml index b3214632bc..23a76c3f7a 100644 --- a/config/model_configs/prognostic_edmfx_simpleplume_column.yml +++ b/config/model_configs/prognostic_edmfx_simpleplume_column.yml @@ -6,7 +6,7 @@ implicit_diffusion: true implicit_sgs_advection: true approximate_linear_solve_iters: 2 max_newton_iters_ode: 3 -gs_tendency: false +zero_tendency: "grid_scale" edmfx_upwinding: first_order edmfx_entr_model: "Generalized" edmfx_detr_model: "Generalized" diff --git a/src/ClimaAtmos.jl b/src/ClimaAtmos.jl index 6c55f0ad7a..4294fe61b1 100644 --- a/src/ClimaAtmos.jl +++ b/src/ClimaAtmos.jl @@ -43,7 +43,7 @@ include(joinpath("utils", "discrete_hydrostatic_balance.jl")) include(joinpath("prognostic_equations", "pressure_work.jl")) include(joinpath("prognostic_equations", "zero_velocity.jl")) -include(joinpath("prognostic_equations", "zero_gridscale_tendency.jl")) +include(joinpath("prognostic_equations", "zero_tendency.jl")) include(joinpath("prognostic_equations", "implicit", "implicit_tendency.jl")) include(joinpath("prognostic_equations", "implicit", "implicit_solver.jl")) diff --git a/src/prognostic_equations/implicit/implicit_tendency.jl b/src/prognostic_equations/implicit/implicit_tendency.jl index efdd47fd5b..e3b217dc5a 100644 --- a/src/prognostic_equations/implicit/implicit_tendency.jl +++ b/src/prognostic_equations/implicit/implicit_tendency.jl @@ -45,10 +45,10 @@ NVTX.@annotate function implicit_tendency!(Yₜ, Y, p, t) # please DO NOT add additional velocity tendencies after this function zero_velocity_tendency!(Yₜ, Y, p, t, colidx) - # NOTE: This will zero out all grid-scale tendencies in the simple edmfx test - # please DO NOT add additional grid-scale tendencies after this function - zero_gridscale_tendency!(Yₜ, Y, p, t, colidx) end + # NOTE: This will zero out all tendencies + # please DO NOT add additional tendencies after this function + zero_tendency!(Yₜ, Y, p, t, p.atmos.tendency_model, p.atmos.turbconv_model) return nothing end diff --git a/src/prognostic_equations/remaining_tendency.jl b/src/prognostic_equations/remaining_tendency.jl index 7b0523de85..6a2f779598 100644 --- a/src/prognostic_equations/remaining_tendency.jl +++ b/src/prognostic_equations/remaining_tendency.jl @@ -103,9 +103,6 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t) # please DO NOT add additional velocity tendencies after this function zero_velocity_tendency!(Yₜ, Y, p, t, colidx) - # NOTE: This will zero out all grid-scale tendencies in the simple edmfx test - # please DO NOT add additional grid-scale tendencies after this function - zero_gridscale_tendency!(Yₜ, Y, p, t, colidx) end # TODO: make bycolumn-able non_orographic_gravity_wave_tendency!( @@ -122,4 +119,7 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t) t, p.atmos.orographic_gravity_wave, ) + # NOTE: This will zero out all tendencies + # please DO NOT add additional tendencies after this function + zero_tendency!(Yₜ, Y, p, t, p.atmos.tendency_model, p.atmos.turbconv_model) end diff --git a/src/prognostic_equations/zero_gridscale_tendency.jl b/src/prognostic_equations/zero_gridscale_tendency.jl deleted file mode 100644 index 04e113eaee..0000000000 --- a/src/prognostic_equations/zero_gridscale_tendency.jl +++ /dev/null @@ -1,17 +0,0 @@ -### -### simple edmfx test -### - -function zero_gridscale_tendency!(Yₜ, Y, p, t, colidx) - # turn off all grid-scale tendencies in the simple edmfx test - if !p.atmos.gs_tendency - @. Yₜ.c.ρ[colidx] = 0 - @. Yₜ.c.uₕ[colidx] = C12(0, 0) - @. Yₜ.f.u₃[colidx] = C3(0) - @. Yₜ.c.ρe_tot[colidx] = 0 - for ρχ_name in filter(is_tracer_var, propertynames(Y.c)) - @. Yₜ.c.:($$ρχ_name)[colidx] = 0 - end - end - return nothing -end diff --git a/src/prognostic_equations/zero_tendency.jl b/src/prognostic_equations/zero_tendency.jl new file mode 100644 index 0000000000..768bdb78d8 --- /dev/null +++ b/src/prognostic_equations/zero_tendency.jl @@ -0,0 +1,36 @@ +### +### Zero grid-scale or subgrid-scale tendencies +### + +zero_tendency!(Yₜ, Y, p, t, _, _) = nothing + +function zero_tendency!(Yₜ, Y, p, t, ::NoGridScaleTendency, _) + # turn off all grid-scale tendencies + @. Yₜ.c.ρ = 0 + @. Yₜ.c.uₕ = C12(0, 0) + @. Yₜ.f.u₃ = C3(0) + @. Yₜ.c.ρe_tot = 0 + for ρχ_name in filter(is_tracer_var, propertynames(Y.c)) + @. Yₜ.c.:($$ρχ_name) = 0 + end + return nothing +end + +function zero_tendency!( + Yₜ, + Y, + p, + t, + ::NoSubgridScaleTendency, + ::PrognosticEDMFX, +) + # turn off all subgrid-scale tendencies + n = n_prognostic_mass_flux_subdomains(p.atmos.turbconv_model) + for j in 1:n + @. Yₜ.c.sgsʲs.:($$j).ρa = 0 + @. Yₜ.f.sgsʲs.:($$j).u₃ = C3(0) + @. Yₜ.c.sgsʲs.:($$j).mse = 0 + @. Yₜ.c.sgsʲs.:($$j).q_tot = 0 + end + return nothing +end diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index ff2a4a0b81..e8a6a765c9 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -438,3 +438,15 @@ function get_tracers(parsed_args) aerosol_names = Tuple(parsed_args["prescribed_aerosols"]) return (; aerosol_names) end + +function get_tendency_model(parsed_args) + zero_tendency_name = parsed_args["zero_tendency"] + @assert zero_tendency_name in (nothing, "grid_scale", "subgrid_scale") + return if zero_tendency_name == "grid_scale" + NoGridScaleTendency() + elseif zero_tendency_name == "subgrid_scale" + NoSubgridScaleTendency() + elseif isnothing(zero_tendency_name) + UseAllTendency() + end +end diff --git a/src/solver/type_getters.jl b/src/solver/type_getters.jl index d1051de29f..9e0010ba33 100644 --- a/src/solver/type_getters.jl +++ b/src/solver/type_getters.jl @@ -26,9 +26,6 @@ function get_atmos(config::AtmosConfig, params) advection_test = parsed_args["advection_test"] @assert advection_test in (false, true) - gs_tendency = parsed_args["gs_tendency"] - @assert gs_tendency in (false, true) - edmfx_entr_model = get_entrainment_model(parsed_args) edmfx_detr_model = get_detrainment_model(parsed_args) @@ -62,7 +59,7 @@ function get_atmos(config::AtmosConfig, params) ls_adv = get_large_scale_advection_model(parsed_args, FT), edmf_coriolis = get_edmf_coriolis(parsed_args, FT), advection_test, - gs_tendency, + tendency_model = get_tendency_model(parsed_args), edmfx_entr_model, edmfx_detr_model, edmfx_sgs_mass_flux, diff --git a/src/solver/types.jl b/src/solver/types.jl index 88943b0d68..f5618f017e 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -227,6 +227,11 @@ quad_type(::SGSQuadrature{N}) where {N} = N #TODO - this seems wrong? abstract type AbstractSurfaceThermoState end struct GCMSurfaceThermoState <: AbstractSurfaceThermoState end +abstract type AbstractTendencyModel end +struct UseAllTendency <: AbstractTendencyModel end +struct NoGridScaleTendency <: AbstractTendencyModel end +struct NoSubgridScaleTendency <: AbstractTendencyModel end + # Define broadcasting for types Base.broadcastable(x::AbstractSurfaceThermoState) = tuple(x) Base.broadcastable(x::AbstractMoistureModel) = tuple(x) @@ -237,6 +242,7 @@ Base.broadcastable(x::DiagnosticEDMFX) = tuple(x) Base.broadcastable(x::AbstractEntrainmentModel) = tuple(x) Base.broadcastable(x::AbstractDetrainmentModel) = tuple(x) Base.broadcastable(x::AbstractSGSamplingType) = tuple(x) +Base.broadcastable(x::AbstractTendencyModel) = tuple(x) Base.@kwdef struct RadiationDYCOMS_RF01{FT} "Large-scale divergence" @@ -327,7 +333,7 @@ Base.@kwdef struct AtmosModel{ LA, EC, AT, - GT, + TM, EEM, EDM, ESMF, @@ -359,7 +365,7 @@ Base.@kwdef struct AtmosModel{ ls_adv::LA = nothing edmf_coriolis::EC = nothing advection_test::AT = nothing - gs_tendency::GT = nothing + tendency_model::TM = nothing edmfx_entr_model::EEM = nothing edmfx_detr_model::EDM = nothing edmfx_sgs_mass_flux::ESMF = nothing diff --git a/toml/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_0M.toml b/toml/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_0M.toml new file mode 100644 index 0000000000..c78bc0e113 --- /dev/null +++ b/toml/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_progedmf_0M.toml @@ -0,0 +1,47 @@ +[zd_rayleigh] +value = 35000.0 + +[alpha_rayleigh_uh] +value = 0.0 + +[precipitation_timescale] +value = 600 + +[EDMF_surface_area] +value = 0 + +[EDMF_min_area] +value = 1.0e-5 + +[EDMF_max_area] +value = 0.7 + +[entr_inv_tau] +value = 0.0002 + +[entr_coeff] +value = 0.2 + +[min_area_limiter_scale] +value = 0 + +[min_area_limiter_power] +value = 100 + +[detr_inv_tau] +value = 0 + +[detr_coeff] +value = 0 + +[detr_buoy_coeff] +value = 0 + +[detr_vertdiv_coeff] +value = 0 + +[detr_massflux_vertdiv_coeff] +value = 1 + +[pressure_normalmode_drag_coeff] +value = 40.0