Skip to content

Commit a4713cf

Browse files
committed
remove ice and snow number density from 2M; fix docs; grab rho_water from params
1 parent bde2725 commit a4713cf

File tree

18 files changed

+56
-167
lines changed

18 files changed

+56
-167
lines changed

.buildkite/pipeline.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,6 @@ steps:
9494
--job_id single_column_precipitation_2M_test
9595
artifact_paths: "single_column_precipitation_2M_test/output_active/*"
9696

97-
- label: ":umbrella: 2-moment precipitation aquaplanet nonequil allsky"
98-
command: >
99-
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
100-
--config_file $CONFIG_PATH/aquaplanet_nonequil_allsky_2M.yml
101-
--job_id aquaplanet_nonequil_allsky_2M
102-
103-
artifact_paths: "aquaplanet_nonequil_allsky_2M/output_active/*"
104-
agents:
105-
slurm_mem: 20GB
106-
slurm_constraint: icelake|cascadelake|skylake|epyc
107-
10897
- group: "Gravity wave"
10998
steps:
11099

@@ -385,6 +374,20 @@ steps:
385374
slurm_mem: 20GB
386375
slurm_constraint: icelake|cascadelake|skylake|epyc
387376

377+
- label: ":umbrella: aquaplanet nonequil allsky monin_obukhov varying insol gravity wave (gfdl_restart) high top 2-moment"
378+
command: >
379+
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
380+
--config_file $CONFIG_PATH/aquaplanet_nonequil_allsky_gw_res_2M.yml
381+
--job_id aquaplanet_nonequil_allsky_gw_res_2M
382+
383+
julia --color=yes --project=.buildkite reproducibility_tests/test_mse.jl
384+
--job_id aquaplanet_nonequil_allsky_gw_res_2M
385+
--out_dir aquaplanet_nonequil_allsky_gw_res_2M/output_active
386+
artifact_paths: "aquaplanet_nonequil_allsky_gw_res_2M/output_active/*"
387+
agents:
388+
slurm_mem: 20GB
389+
slurm_constraint: icelake|cascadelake|skylake|epyc
390+
388391
- label: ":computer: aquaplanet equil allsky monin_obukhov varying insol gravity wave (raw_topo) high top zonally asymmetric"
389392
command: >
390393
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl

config/model_configs/aquaplanet_nonequil_allsky_2M.yml renamed to config/model_configs/aquaplanet_nonequil_allsky_gw_res_2M.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ diagnostics:
2525
- short_name: [edt, evu, mmrso4, mmrbcpo, mmrocpo, mmrdust, mmrss, loadss, o3, od550aer, odsc550aer]
2626
reduction_time: average
2727
period: 1days
28+
- short_name: [hus, clw, cli, husra, hussn, cdnc, ncra]
29+
reduction_time: average
30+
period: 1days
2831
- short_name: [reffclw, reffcli]
2932
period: 6hours

config/model_configs/single_column_precipitation_2M_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ implicit_diffusion: true
1616
approximate_linear_solve_iters: 2
1717
reproducibility_test: false
1818
diagnostics:
19-
- short_name: [hus, clw, cli, husra, hussn, cdnc, cdinc, ncra, ncsn, ta, wa]
19+
- short_name: [hus, clw, cli, husra, hussn, cdnc, ncra, ta, wa]
2020
period: 500secs
2121
- short_name: [pr]
2222
period: 10secs

post_processing/ci_plots.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,10 @@ function make_plots(
645645
"hussn",
646646
"ta",
647647
"cdnc",
648-
"cdinc",
649648
"ncra",
650-
"ncsn",
651649
]
652-
figsize = (1200, 1000)
653-
pr_row = 5
650+
figsize = (1200, 800)
651+
pr_row = 4
654652
end
655653

656654
vars = [
@@ -1153,7 +1151,7 @@ AquaplanetPlots = Union{
11531151
Val{:edonly_edmfx_aquaplanet},
11541152
Val{:mpi_sphere_aquaplanet_rhoe_equil_clearsky},
11551153
Val{:aquaplanet_nonequil_allsky_gw_res},
1156-
Val{:aquaplanet_nonequil_allsky_2M},
1154+
Val{:aquaplanet_nonequil_allsky_gw_res_2M},
11571155
Val{:rcemipii_sphere_diagnostic_edmfx},
11581156
Val{:longrun_aquaplanet_allsky_0M},
11591157
Val{:longrun_aquaplanet_allsky_diagedmf_0M},
@@ -1165,11 +1163,11 @@ AquaplanetPlots = Union{
11651163
Val{:amip_target_edonly},
11661164
}
11671165

1168-
function make_plots(::AquaplanetPlots, output_paths::Vector{<:AbstractString})
1166+
function make_plots(sim_type::AquaplanetPlots, output_paths::Vector{<:AbstractString})
11691167
simdirs = SimDir.(output_paths)
11701168

11711169
reduction = "average"
1172-
short_names_3D = ["ua", "ta", "hus"]
1170+
short_names_3D = sim_type isa Val{:aquaplanet_nonequil_allsky_gw_res_2M} ? ["ua", "ta", "hus", "clw", "cli", "husra", "hussn", "cdnc", "ncra"] : ["ua", "ta", "hus"]
11731171
short_names_2D = [
11741172
"rsdt",
11751173
"rsds",

src/cache/precipitation_precomputed_quantities.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ function set_precipitation_velocities!(
104104
moisture_model::NonEquilMoistModel,
105105
precip_model::Microphysics2Moment,
106106
)
107-
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwnₗ, ᶜwnᵢ, ᶜwnᵣ, ᶜwnₛ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) =
108-
p.precomputed
107+
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwnₗ, ᶜwnᵣ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) = p.precomputed
109108
(; q_liq, q_ice, q_rai, q_sno) = p.precomputed.ᶜspecific
110109
(; ᶜΦ) = p.core
111110

@@ -124,16 +123,14 @@ function set_precipitation_velocities!(
124123
CM2.rain_terminal_velocity(cm2p.sb, cm2p.tv, q_rai, Y.c.ρ, Y.c.ρn_rai),
125124
2,
126125
)
127-
@. ᶜwnₛ = CM1.terminal_velocity(cm1p.ps, cm1p.tv.snow, Y.c.ρ, q_sno)
128126
@. ᶜwₛ = CM1.terminal_velocity(cm1p.ps, cm1p.tv.snow, Y.c.ρ, q_sno)
129127
# compute sedimentation velocity for cloud condensate [m/s]
130128
# TODO sedimentation velocities of cloud condensates are based
131-
# on the 1M scheme.
129+
# on the 1M scheme. Sedimentation velocity of cloud number concentration
130+
# is equal to that of the mass.
132131
@. ᶜwnₗ =
133132
CMNe.terminal_velocity(cm1c.liquid, cm1c.Ch2022.rain, Y.c.ρ, q_liq)
134133
@. ᶜwₗ = CMNe.terminal_velocity(cm1c.liquid, cm1c.Ch2022.rain, Y.c.ρ, q_liq)
135-
@. ᶜwnᵢ =
136-
CMNe.terminal_velocity(cm1c.ice, cm1c.Ch2022.small_ice, Y.c.ρ, q_ice)
137134
@. ᶜwᵢ =
138135
CMNe.terminal_velocity(cm1c.ice, cm1c.Ch2022.small_ice, Y.c.ρ, q_ice)
139136

@@ -323,7 +320,7 @@ function set_precipitation_cache!(Y, p, ::Microphysics2Moment, _)
323320
(; dt) = p
324321
(; ᶜts) = p.precomputed
325322
(; ᶜSqₗᵖ, ᶜSqᵢᵖ, ᶜSqᵣᵖ, ᶜSqₛᵖ) = p.precomputed
326-
(; ᶜSnₗᵖ, ᶜSnᵢᵖ, ᶜSnᵣᵖ, ᶜSnₛᵖ) = p.precomputed
323+
(; ᶜSnₗᵖ, ᶜSnᵣᵖ) = p.precomputed
327324

328325
(; q_liq, q_rai, n_liq, n_rai) = p.precomputed.ᶜspecific
329326

@@ -357,8 +354,6 @@ function set_precipitation_cache!(Y, p, ::Microphysics2Moment, _)
357354
#TODO - implement 2M cold processes!
358355
@. ᶜSqᵢᵖ = 0
359356
@. ᶜSqₛᵖ = 0
360-
@. ᶜSnᵢᵖ = 0
361-
@. ᶜSnₛᵖ = 0
362357

363358
return nothing
364359
end

src/cache/precomputed_quantities.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ function precomputed_quantities(Y, atmos)
129129
(;
130130
ᶜwₗ = similar(Y.c, FT),
131131
ᶜwᵢ = similar(Y.c, FT),
132-
ᶜwnₗ = similar(Y.c, FT),
133-
ᶜwnᵢ = similar(Y.c, FT),
134132
) : (;)
135133
if atmos.precip_model isa Microphysics0Moment
136134
precipitation_quantities =
@@ -152,12 +150,10 @@ function precomputed_quantities(Y, atmos)
152150
ᶜSqᵢᵖ = similar(Y.c, FT),
153151
ᶜSqᵣᵖ = similar(Y.c, FT),
154152
ᶜSqₛᵖ = similar(Y.c, FT),
153+
ᶜwnₗ = similar(Y.c, FT),
155154
ᶜwnᵣ = similar(Y.c, FT),
156-
ᶜwnₛ = similar(Y.c, FT),
157155
ᶜSnₗᵖ = similar(Y.c, FT),
158-
ᶜSnᵢᵖ = similar(Y.c, FT),
159156
ᶜSnᵣᵖ = similar(Y.c, FT),
160-
ᶜSnₛᵖ = similar(Y.c, FT),
161157
)
162158
else
163159
precipitation_quantities = (;)

src/diagnostics/core_diagnostics.jl

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -891,37 +891,6 @@ add_diagnostic_variable!(
891891
compute! = compute_cdnc!,
892892
)
893893

894-
compute_cdinc!(out, state, cache, time) =
895-
compute_cdinc!(out, state, cache, time, cache.atmos.precip_model)
896-
compute_cdinc!(_, _, _, _, model::T) where {T} =
897-
error_diagnostic_variable("cdinc", model)
898-
899-
function compute_cdinc!(
900-
out,
901-
state,
902-
cache,
903-
time,
904-
precip_model::Microphysics2Moment,
905-
)
906-
if isnothing(out)
907-
return state.c.ρn_ice
908-
else
909-
out .= state.c.ρn_ice
910-
end
911-
end
912-
913-
add_diagnostic_variable!(
914-
short_name = "cdinc",
915-
long_name = "Cloud Ice Chrystal Number Concentration",
916-
standard_name = "number_concentration_of_cloud_ice_chrystals_in_air",
917-
units = "m^-3",
918-
comments = """
919-
This is calculated as the number of cloud ice chrystals in the grid
920-
cell divided by the cell volume.
921-
""",
922-
compute! = compute_cdinc!,
923-
)
924-
925894
compute_ncra!(out, state, cache, time) =
926895
compute_ncra!(out, state, cache, time, cache.atmos.precip_model)
927896
compute_ncra!(_, _, _, _, model::T) where {T} =
@@ -953,37 +922,6 @@ add_diagnostic_variable!(
953922
compute! = compute_ncra!,
954923
)
955924

956-
compute_ncsn!(out, state, cache, time) =
957-
compute_ncsn!(out, state, cache, time, cache.atmos.precip_model)
958-
compute_ncsn!(_, _, _, _, model::T) where {T} =
959-
error_diagnostic_variable("ncsn", model)
960-
961-
function compute_ncsn!(
962-
out,
963-
state,
964-
cache,
965-
time,
966-
precip_model::Microphysics2Moment,
967-
)
968-
if isnothing(out)
969-
return state.c.ρn_sno
970-
else
971-
out .= state.c.ρn_sno
972-
end
973-
end
974-
975-
add_diagnostic_variable!(
976-
short_name = "ncsn",
977-
long_name = "Snowflake Number Concentration",
978-
standard_name = "number_concentration_of_snowflakes_in_air",
979-
units = "m^-3",
980-
comments = """
981-
This is calculated as the number of snow flakes in the grid cell divided
982-
by the cell volume.
983-
""",
984-
compute! = compute_ncsn!,
985-
)
986-
987925
###
988926
# Topography
989927
###

src/diagnostics/default_diagnostics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function default_diagnostics(
236236
start_date;
237237
output_writer,
238238
)
239-
precip_diagnostics = ["husra", "hussn", "cdnc", "cdinc", "ncra", "ncsn"]
239+
precip_diagnostics = ["husra", "hussn", "cdnc", "ncra"]
240240

241241
average_func = frequency_averages(duration)
242242

src/initial_conditions/atmos_state.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,10 @@ precip_variables(ls, ::Microphysics1Moment) = (;
128128
ρq_sno = ls.ρ * ls.precip_state.q_sno,
129129
)
130130
precip_variables(ls, ::Microphysics2Moment) = (;
131+
ρn_liq = ls.ρ * ls.precip_state.n_liq,
132+
ρn_rai = ls.ρ * ls.precip_state.n_rai,
131133
ρq_rai = ls.ρ * ls.precip_state.q_rai,
132134
ρq_sno = ls.ρ * ls.precip_state.q_sno,
133-
ρn_rai = ls.ρ * ls.precip_state.n_rai,
134-
ρn_sno = ls.ρ * ls.precip_state.n_sno,
135-
ρn_liq = ls.ρ * ls.precip_state.n_liq,
136-
ρn_ice = ls.ρ * ls.precip_state.n_ice,
137135
)
138136

139137
# We can use paper-based cases for LES type configurations (no TKE)

src/initial_conditions/initial_conditions.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,13 +1200,11 @@ function (initial_condition::PrecipitatingColumn)(params)
12001200
thermo_params = CAP.thermodynamics_params(params)
12011201
p_0 = FT(101300.0)
12021202
qᵣ = prescribed_prof(FT, 2000, 5000, 1e-6)
1203-
nᵣ = prescribed_prof(FT, 2000, 5000, 1e3)
12041203
qₛ = prescribed_prof(FT, 5000, 8000, 2e-6)
1205-
nₛ = prescribed_prof(FT, 5000, 8000, 1e3)
12061204
qₗ = prescribed_prof(FT, 4000, 5500, 2e-5)
1207-
nₗ = prescribed_prof(FT, 4000, 5500, 1e7)
12081205
qᵢ = prescribed_prof(FT, 6000, 9000, 1e-5)
1209-
nᵢ = prescribed_prof(FT, 6000, 9000, 1e6)
1206+
nₗ = prescribed_prof(FT, 4000, 5500, 1e7)
1207+
nᵣ = prescribed_prof(FT, 2000, 5000, 1e3)
12101208
θ = APL.Rico_θ_liq_ice(FT)
12111209
q_tot = APL.Rico_q_tot(FT)
12121210
u = prescribed_prof(FT, 0, Inf, 0)
@@ -1227,12 +1225,10 @@ function (initial_condition::PrecipitatingColumn)(params)
12271225
velocity = Geometry.UVVector(u(z), v(z)),
12281226
turbconv_state = nothing,
12291227
precip_state = PrecipState2M(;
1230-
q_rai = qᵣ(z),
1231-
q_sno = qₛ(z),
12321228
n_liq = nₗ(z),
1233-
n_ice = nᵢ(z),
12341229
n_rai = nᵣ(z),
1235-
n_sno = nₛ(z),
1230+
q_rai = qᵣ(z),
1231+
q_sno = qₛ(z),
12361232
),
12371233
)
12381234
end

0 commit comments

Comments
 (0)