Skip to content

Commit 5b57e15

Browse files
Merge pull request #3886 from CliMA/ne/atmos_model
Rename variable after AtmosModel refactor
2 parents 3ca345b + a909d7d commit 5b57e15

40 files changed

+288
-256
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ClimaAtmos.jl Release Notes
44
main
55
-------
66

7+
PR [#3886](https://github.com/CliMA/ClimaAtmos.jl/pull/3886) renames `PrognosticSurfaceTemperature` -> `SlabOceanSST`, `PrescribedSurfaceTemperature` -> `PrescribedSST` and deprecates the `prognostic_surface = "Prognostic/PrescribedSurfaceTemperature"` config argument
8+
79
PR [#3883](https://github.com/CliMA/ClimaAtmos.jl/pull/3883) adds atmosphere initial condition for WeatherQuest from ERA5
810

911
PR [#3870](https://github.com/CliMA/ClimaAtmos.jl/pull/3870) adds externally driven SCM models forced by monthly-averaged ERA5
@@ -12,7 +14,6 @@ factor speedup. The associated documentation section, "Single Column Model", was
1214

1315
v0.30.4
1416
-------
15-
1617
PR [#3856](https://github.com/CliMA/ClimaAtmos.jl/pull/3856) adds number adjustment tendencies to the two-moment microphysics scheme.
1718

1819
v0.30.3

config/default_configs/default_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ prognostic_tke:
272272
help: "A flag for prognostic TKE [`false` (default), `true`]"
273273
value: false
274274
prognostic_surface:
275-
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `PrognosticSurfaceTemperature`, `PrescribedSurfaceTemperature`]"
275+
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `SlabOceanSST`, `PrescribedSST`]"
276276
value: false
277277
albedo_model:
278278
help: "Variable surface albedo [`ConstantAlbedo` (default), `RegressionFunctionAlbedo`, `CouplerAlbedo`]"

config/longrun_configs/longrun_aquaplanet_allsky_tvinsol_0M_slabocean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ t_end: "360days"
1111
dt_save_state_to_disk: "30days"
1212
check_conservation: true
1313
moist: "equil"
14-
prognostic_surface: "PrognosticSurfaceTemperature"
14+
prognostic_surface: "SlabOceanSST"
1515
albedo_model: "RegressionFunctionAlbedo"
1616
surface_setup: "DefaultMoninObukhov"
1717
vert_diff: "DecayWithHeightDiffusion"

config/model_configs/aquaplanet_equil_clearsky_tvinsol_0M_slabocean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ approximate_linear_solve_iters: 2
1010
rad: "clearsky"
1111
insolation: "timevarying"
1212
dt_rad: "1hours"
13-
prognostic_surface: "PrognosticSurfaceTemperature"
13+
prognostic_surface: "SlabOceanSST"
1414
check_conservation: true

config/model_configs/aquaplanet_equil_clearsky_tvinsol_0M_slabocean_ft64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ approximate_linear_solve_iters: 2
1010
rad: "clearsky"
1111
insolation: "timevarying"
1212
dt_rad: "1hours"
13-
prognostic_surface: "PrognosticSurfaceTemperature"
13+
prognostic_surface: "SlabOceanSST"
1414
check_conservation: true

config/model_configs/baroclinic_wave_equil_conservation_source.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dt: "400secs"
33
t_end: "10days"
44
moist: "equil"
55
surface_setup: DefaultMoninObukhov
6-
prognostic_surface: "PrognosticSurfaceTemperature"
6+
prognostic_surface: "SlabOceanSST"
77
rad: "clearsky"
88
precip_model: "0M"
99
vert_diff: true

src/cache/cache.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function build_cache(
111111
net_energy_flux_sfc = [Geometry.WVector(FT(0))]
112112

113113
conservation_check =
114-
!(atmos.precip_model isa NoPrecipitation) ?
114+
!(atmos.microphysics_model isa NoPrecipitation) ?
115115
(;
116116
col_integrated_precip_energy_tendency = zeros(
117117
axes(Fields.level(Geometry.WVector.(Y.f.u₃), half)),

src/cache/diagnostic_edmf_precomputed_quantities.jl

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function compute_ρaʲu³ʲ(
272272
detrʲ_prev_level,
273273
u³ʲ_data_prev_halflevel,
274274
S_q_totʲ_prev_level,
275-
precip_model,
275+
microphysics_model,
276276
)
277277

278278
ρaʲu³ʲ_data =
@@ -282,7 +282,7 @@ function compute_ρaʲu³ʲ(
282282
ρaʲu³ʲ_data +=
283283
(1 / J_halflevel) *
284284
(J_prev_level * ρaʲ_prev_level * (entrʲ_prev_level - detrʲ_prev_level))
285-
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
285+
if microphysics_model isa Union{Microphysics0Moment, Microphysics1Moment}
286286
ρaʲu³ʲ_data +=
287287
(1 / J_halflevel) *
288288
(J_prev_level * ρaʲ_prev_level * S_q_totʲ_prev_level)
@@ -295,7 +295,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
295295
p,
296296
t,
297297
)
298-
(; turbconv_model, precip_model) = p.atmos
298+
(; turbconv_model, microphysics_model) = p.atmos
299299
FT = eltype(Y)
300300
n = n_mass_flux_subdomains(turbconv_model)
301301
ᶜz = Fields.coordinate_field(Y.c).z
@@ -323,7 +323,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
323323
) = p.precomputed
324324
(; ᶠu³⁰, ᶜK⁰, ᶜtke⁰) = p.precomputed
325325

326-
if precip_model isa Microphysics1Moment
326+
if microphysics_model isa Microphysics1Moment
327327
ᶜq_liqʲs = p.precomputed.ᶜq_liqʲs
328328
ᶜq_iceʲs = p.precomputed.ᶜq_iceʲs
329329
q_rai = p.precomputed.ᶜqᵣ
@@ -384,7 +384,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
384384
z_prev_level = Fields.field_values(Fields.level(ᶜz, i - 1))
385385
dz_prev_level = Fields.field_values(Fields.level(ᶜdz, i - 1))
386386

387-
if precip_model isa Microphysics1Moment
387+
if microphysics_model isa Microphysics1Moment
388388
q_rai_prev_level = Fields.field_values(Fields.level(q_rai, i - 1))
389389
q_sno_prev_level = Fields.field_values(Fields.level(q_sno, i - 1))
390390
end
@@ -409,10 +409,11 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
409409
ᶠnh_pressure³_buoyʲ = ᶠnh_pressure³_buoyʲs.:($j)
410410
ᶠnh_pressure³_dragʲ = ᶠnh_pressure³_dragʲs.:($j)
411411

412-
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
412+
if microphysics_model isa
413+
Union{Microphysics0Moment, Microphysics1Moment}
413414
ᶜS_q_totʲ = p.precomputed.ᶜSqₜᵖʲs.:($j)
414415
end
415-
if precip_model isa Microphysics1Moment
416+
if microphysics_model isa Microphysics1Moment
416417
ᶜS_q_raiʲ = p.precomputed.ᶜSqᵣᵖʲs.:($j)
417418
ᶜS_q_snoʲ = p.precomputed.ᶜSqₛᵖʲs.:($j)
418419
ᶜS_e_totʲ = p.precomputed.ᶜSeₜᵖʲs.:($j)
@@ -455,13 +456,13 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
455456
CAP.R_d(params) * CAP.T_surf_ref(params) / CAP.grav(params)
456457

457458
S_q_totʲ_prev_level =
458-
if precip_model isa
459+
if microphysics_model isa
459460
Union{Microphysics0Moment, Microphysics1Moment}
460461
Fields.field_values(Fields.level(ᶜS_q_totʲ, i - 1))
461462
else
462463
Ref(nothing)
463464
end
464-
if precip_model isa Microphysics1Moment
465+
if microphysics_model isa Microphysics1Moment
465466
S_q_raiʲ_prev_level =
466467
Fields.field_values(Fields.level(ᶜS_q_raiʲ, i - 1))
467468
S_q_snoʲ_prev_level =
@@ -571,15 +572,15 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
571572
# Updraft q_tot sources from precipitation formation
572573
# To be applied in updraft continuity, moisture and energy
573574
# for updrafts and grid mean
574-
if precip_model isa Microphysics0Moment
575+
if microphysics_model isa Microphysics0Moment
575576
@. S_q_totʲ_prev_level = q_tot_0M_precipitation_sources(
576577
thermo_params,
577578
microphys_0m_params,
578579
dt,
579580
q_totʲ_prev_level,
580581
tsʲ_prev_level,
581582
)
582-
elseif precip_model isa Microphysics1Moment
583+
elseif microphysics_model isa Microphysics1Moment
583584
compute_precipitation_sources!(
584585
Sᵖ_prev_level,
585586
Sᵖ_snow_prev_level,
@@ -689,7 +690,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
689690
detrʲ_prev_level,
690691
u³ʲ_data_prev_halflevel,
691692
S_q_totʲ_prev_level,
692-
precip_model,
693+
microphysics_model,
693694
)
694695

695696
@. u³ʲ_halflevel = ifelse(
@@ -733,7 +734,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
733734
mseʲ_prev_level
734735
)
735736
)
736-
if precip_model isa Microphysics0Moment
737+
if microphysics_model isa Microphysics0Moment
737738
@. ρaʲu³ʲ_datamse +=
738739
(1 / local_geometry_halflevel.J) * (
739740
local_geometry_prev_level.J *
@@ -747,7 +748,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
747748
)
748749
)
749750
)
750-
elseif precip_model isa Microphysics1Moment
751+
elseif microphysics_model isa Microphysics1Moment
751752
@. ρaʲu³ʲ_datamse +=
752753
(1 / local_geometry_halflevel.J) * (
753754
local_geometry_prev_level.J *
@@ -782,7 +783,8 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
782783
q_totʲ_prev_level
783784
)
784785
)
785-
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
786+
if microphysics_model isa
787+
Union{Microphysics0Moment, Microphysics1Moment}
786788
@. ρaʲu³ʲ_dataq_tot +=
787789
(1 / local_geometry_halflevel.J) * (
788790
local_geometry_prev_level.J *
@@ -885,7 +887,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_top_bc!(
885887
(; ᶜentrʲs, ᶜdetrʲs, ᶜturb_entrʲs) = p.precomputed
886888
(; ᶠu³⁰, ᶠu³ʲs, ᶜuʲs, ᶠnh_pressure³_buoyʲs, ᶠnh_pressure³_dragʲs) =
887889
p.precomputed
888-
(; precip_model) = p.atmos
890+
(; microphysics_model) = p.atmos
889891

890892
# set values for the top level
891893
i_top = Spaces.nlevels(axes(Y.c))
@@ -924,12 +926,13 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_top_bc!(
924926
fill!(turb_entrʲ_level, RecursiveApply.rzero(eltype(turb_entrʲ_level)))
925927
@. ᶜuʲ = C123(Y.c.uₕ) + ᶜinterp(C123(ᶠu³ʲ))
926928

927-
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
929+
if microphysics_model isa
930+
Union{Microphysics0Moment, Microphysics1Moment}
928931
ᶜS_q_totʲ = p.precomputed.ᶜSqₜᵖʲs.:($j)
929932
S_q_totʲ_level = Fields.field_values(Fields.level(ᶜS_q_totʲ, i_top))
930933
@. S_q_totʲ_level = 0
931934
end
932-
if precip_model isa Microphysics1Moment
935+
if microphysics_model isa Microphysics1Moment
933936
ᶜS_q_raiʲ = p.precomputed.ᶜSqᵣᵖʲs.:($j)
934937
ᶜS_q_snoʲ = p.precomputed.ᶜSqₛᵖʲs.:($j)
935938
ᶜS_e_totʲ = p.precomputed.ᶜSeₜᵖʲs.:($j)
@@ -954,7 +957,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_closures!
954957
p,
955958
t,
956959
)
957-
(; moisture_model, turbconv_model, precip_model) = p.atmos
960+
(; moisture_model, turbconv_model, microphysics_model) = p.atmos
958961
n = n_mass_flux_subdomains(turbconv_model)
959962
ᶜz = Fields.coordinate_field(Y.c).z
960963
ᶜdz = Fields.Δz_field(axes(Y.c))
@@ -1072,7 +1075,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_precipita
10721075
Y,
10731076
p,
10741077
t,
1075-
precip_model::Microphysics0Moment,
1078+
microphysics_model::Microphysics0Moment,
10761079
)
10771080
thermo_params = CAP.thermodynamics_params(p.params)
10781081
microphys_0m_params = CAP.microphysics_0m_params(p.params)
@@ -1093,7 +1096,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_precipita
10931096
Y,
10941097
p,
10951098
t,
1096-
precip_model::Microphysics1Moment,
1099+
microphysics_model::Microphysics1Moment,
10971100
)
10981101
error("Not implemented yet")
10991102
#thermo_params = CAP.thermodynamics_params(p.params)

src/cache/precipitation_precomputed_quantities.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Kin(ᶜw_precip, ᶜu_air)
3131
end
3232

3333
"""
34-
set_precipitation_velocities!(Y, p, moisture_model, precip_model)
34+
set_precipitation_velocities!(Y, p, moisture_model, microphysics_model)
3535
3636
Updates the precipitation terminal velocity, cloud sedimentation velocity,
3737
and their contribution to total water and energy advection.
@@ -46,7 +46,7 @@ function set_precipitation_velocities!(
4646
Y,
4747
p,
4848
moisture_model::NonEquilMoistModel,
49-
precip_model::Microphysics1Moment,
49+
microphysics_model::Microphysics1Moment,
5050
)
5151
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) = p.precomputed
5252
(; ᶜΦ) = p.core
@@ -102,7 +102,7 @@ function set_precipitation_velocities!(
102102
Y,
103103
p,
104104
moisture_model::NonEquilMoistModel,
105-
precip_model::Microphysics2Moment,
105+
microphysics_model::Microphysics2Moment,
106106
)
107107
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwnₗ, ᶜwnᵣ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) = p.precomputed
108108
(; ᶜΦ) = p.core
@@ -182,7 +182,7 @@ function set_precipitation_velocities!(
182182
end
183183

184184
"""
185-
set_precipitation_cache!(Y, p, precip_model, turbconv_model)
185+
set_precipitation_cache!(Y, p, microphysics_model, turbconv_model)
186186
187187
Computes the cache needed for precipitation tendencies. When run without edmf
188188
model this involves computing precipitation sources based on the grid mean
@@ -423,7 +423,7 @@ set_precipitation_surface_fluxes!(Y, p, _) = nothing
423423
function set_precipitation_surface_fluxes!(
424424
Y,
425425
p,
426-
precip_model::Microphysics0Moment,
426+
microphysics_model::Microphysics0Moment,
427427
)
428428
ᶜT = p.scratch.ᶜtemp_scalar
429429
(; ᶜts) = p.precomputed # assume ᶜts has been updated
@@ -450,7 +450,7 @@ end
450450
function set_precipitation_surface_fluxes!(
451451
Y,
452452
p,
453-
precip_model::Union{Microphysics1Moment, Microphysics2Moment},
453+
microphysics_model::Union{Microphysics1Moment, Microphysics2Moment},
454454
)
455455
(; surface_rain_flux, surface_snow_flux) = p.precomputed
456456
(; col_integrated_precip_energy_tendency,) = p.conservation_check

0 commit comments

Comments
 (0)