Skip to content

Commit 6ec9175

Browse files
committed
Add RCEMIPII analytic sounding initial condition
1 parent 61ae2da commit 6ec9175

File tree

8 files changed

+203
-0
lines changed

8 files changed

+203
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,17 @@ steps:
168168
agents:
169169
slurm_mem: 20GB
170170

171+
- label: ":computer: CRM rcemipii in a box with 1M"
172+
command: >
173+
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
174+
--config_file $CONFIG_PATH/rcemipii_box_CRM_1M.yml
175+
--job_id rcemipii_box_CRM_1M
176+
177+
julia --color=yes --project=.buildkite reproducibility_tests/test_mse.jl
178+
--job_id rcemipii_box_CRM_1M
179+
--out_dir rcemipii_box_CRM_1M/output_active
180+
artifact_paths: "rcemipii_box_CRM_1M/output_active/*"
181+
171182
- label: ":genie: LES ISDAC in a box"
172183
command: >
173184
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
reference_job_id: les_box # for plotting
2+
surface_setup: DefaultMoninObukhov
3+
surface_temperature: RCEMIPII
4+
insolation: rcemipii
5+
initial_condition: RCEMIPIIProfile_300
6+
config: box
7+
rad: allskywithclear
8+
co2_model: fixed
9+
approximate_linear_solve_iters: 2 # only valid when implicit_diffusion=true
10+
rayleigh_sponge: true # set sponge level in toml file
11+
smagorinsky_lilly: "UV"
12+
implicit_diffusion: true
13+
14+
reproducibility_test: true
15+
16+
# Reference diffusion setup
17+
vert_diff: "DecayWithHeightDiffusion"
18+
hyperdiff: "false"
19+
20+
# microphysics
21+
### !! 1M and 2M !!
22+
cloud_model: grid_scale # Ultimately wanted when `moist: nonequil`
23+
moist: nonequil
24+
precip_model: 1M
25+
### spatial discretization ###
26+
x_max: 96000.0 # 96km
27+
y_max: 96000.0 # 96km
28+
# x_max: 6000000.0 # 6000km
29+
# y_max: 400000.0 # 400km
30+
z_max: 30000.0 # 30km
31+
nh_poly: 3 # hor. poly deg -> # quad pts in 1D in a h. elem is Nq = nh + 1
32+
# z_elem: 43 # Note: Set sponge height (`zd_viscous`) in toml file to cover top ~5 points
33+
z_elem: 86
34+
dz_bottom: 30.0
35+
36+
#~8km grid
37+
x_elem: 4
38+
y_elem: 4
39+
dt: 10secs
40+
# ~4km grid
41+
# x_elem: 8
42+
# y_elem: 8
43+
# dt: 5secs
44+
# ~2km grid
45+
# x_elem: 16
46+
# y_elem: 16
47+
# dt: 2secs
48+
# ~1km grid
49+
# x_elem: 32
50+
# y_elem: 32
51+
# dt: 1secs
52+
53+
t_end: 10hours
54+
# t_end: 2days
55+
# t_end: 1days
56+
# t_end: 21days
57+
58+
## >> During debugging, reduce these as appropriate
59+
dt_save_state_to_disk: 1days
60+
dt_rad: 1hours # same as `dt_save_state_to_disk` for reproducibility
61+
check_nan_every: 1024 # for debugging: set to check NaNs every `n` iterations
62+
log_to_file: true
63+
## <<
64+
65+
toml: [toml/rcemipii_box.toml]
66+
67+
# enable_diagnostics: false
68+
output_default_diagnostics: false # adds various 1h diagnostics. Only use if `dt_save_state_to_disk` is a multiple of 1hr
69+
diagnostics:
70+
- short_name: [
71+
wa, ua, va, ta, thetaa, ha, # dynamics & thermodynamics
72+
hus, hur, cl, clw, cli, # liquid
73+
pr, # precipitation
74+
ke, # kinetic energy for spectrum
75+
# Smagorinsky diagnostics
76+
Dh_smag, strainh_smag, # horizontal
77+
# Dv_smag, strainv_smag, # vertical
78+
# DecayWithHeight diffusion coefficient
79+
edt,
80+
]
81+
# period: 10mins
82+
period: 1hours
83+
## 1M microphsics
84+
- short_name: [husra, hussn]
85+
# period: 10mins
86+
period: 1hours
87+
# 2M microphysics
88+
# - short_name: [cdnc, ncra]
89+
# period: 10mins

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ClimaAtmos.InitialConditions.TRMM_LBA
4141
ClimaAtmos.InitialConditions.LifeCycleTan2018
4242
ClimaAtmos.InitialConditions.Bomex
4343
ClimaAtmos.InitialConditions.Soares
44+
ClimaAtmos.InitialConditions.RCEMIPIIProfile
4445
```
4546

4647
### Helper

reproducibility_tests/ref_counter.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121

2222
#=
23+
278
24+
- Add 1M Cloud Resolving Model (CRM) RCEMIPII in a box test
25+
2326
277
2427
- Update to use [email protected]. Supports Charnock-parameterization for aerodynamic roughness (default is still user-prescribed ScalarRoughness). SurfaceFluxes catch for neutrally-stable boundary layers (ζ ≈ 0) removed.
2528

reproducibility_tests/reproducibility_test_job_ids.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ reproducibility_test_job_ids() = [
77
"diagnostic_edmfx_aquaplanet",
88
"single_column_hydrostatic_balance_ft64",
99
"prognostic_edmfx_aquaplanet",
10+
"rcemipii_box_CRM_1M",
1011
]

src/initial_conditions/initial_conditions.jl

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,67 @@ function (initial_condition::RisingThermalBubbleProfile)(params)
358358
return local_state
359359
end
360360

361+
"""
362+
RCEMIPIIProfile(temperature, humidity)
363+
364+
An `InitialCondition` following the sounding to initialize simulations for
365+
RCEMIPII as described by Wing et. al. (2018)
366+
(https://doi.org/10.5194/gmd-11-793-2018). There are three input profiles:
367+
RCEMIPIIProfile_295, RCEMIPIIProfile_300, and RCEMIPIIProfile_305, that specify
368+
three different SST temperatures and different initial specific humidity
369+
profiles. Note: this should be used for RCE_small and NOT
370+
RCE_large - RCE_large must be initialized with the final state of RCE_small.
371+
"""
372+
struct RCEMIPIIProfile{FT} <: InitialCondition
373+
temperature::FT
374+
humidity::FT
375+
end
376+
377+
RCEMIPIIProfile_295() = RCEMIPIIProfile(295.0, 12e-3)
378+
RCEMIPIIProfile_300() = RCEMIPIIProfile(300.0, 18.65e-3)
379+
RCEMIPIIProfile_305() = RCEMIPIIProfile(305.0, 24e-3)
380+
381+
function (initial_condition::RCEMIPIIProfile)(params)
382+
(; temperature, humidity) = initial_condition
383+
function local_state(local_geometry)
384+
FT = eltype(params)
385+
R_d = CAP.R_d(params)
386+
grav = CAP.grav(params)
387+
thermo_params = CAP.thermodynamics_params(params)
388+
389+
T_0 = FT(temperature)
390+
q_0 = FT(humidity)
391+
392+
q_t = FT(10^(-14)) # kg kg -1
393+
z_q1 = FT(4000) # m
394+
z_q2 = FT(7500) # m
395+
z_t = FT(15000) # m
396+
Γ = FT(0.0067) # K m-1
397+
p_0 = FT(101480) # Pa
398+
399+
T_v0 = T_0 * (1 + FT(0.608) * q_0)
400+
T_vt = T_v0 - Γ * z_t
401+
402+
p_t = p_0 * (T_vt / T_v0)^(grav / (R_d * Γ))
403+
404+
(; z) = local_geometry.coordinates
405+
406+
q = z z_t ? q_0 * exp(-z / z_q1) * exp(-(z / z_q2)^2) : q_t
407+
T_v = z z_t ? T_v0 - Γ * z : T_vt
408+
T = T_v / (1 + FT(0.608) * q)
409+
p =
410+
z z_t ? p_0 * ((T_v0 - Γ * z) / T_v0)^(grav / (R_d * Γ)) :
411+
p_t * exp(-grav * (z - z_t) / (R_d * T_vt))
412+
413+
return LocalState(;
414+
params,
415+
geometry = local_geometry,
416+
thermo_state = TD.PhaseEquil_pTq(thermo_params, p, T, q),
417+
)
418+
end
419+
return local_state
420+
end
421+
361422
"""
362423
overwrite_initial_conditions!(initial_condition, args...)
363424

src/solver/type_getters.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ function get_initial_condition(parsed_args, atmos)
414414
"DryDensityCurrentProfile",
415415
"RisingThermalBubbleProfile",
416416
"PrecipitatingColumn",
417+
"RCEMIPIIProfile_295",
418+
"RCEMIPIIProfile_300",
419+
"RCEMIPIIProfile_305",
417420
]
418421
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))()
419422
elseif isfile(parsed_args["initial_condition"])

toml/rcemipii_box.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# toml/rcemipii_box.toml
2+
3+
[c_smag]
4+
value = 1.0
5+
6+
[condensation_evaporation_timescale]
7+
value = 50
8+
9+
[sublimation_deposition_timescale]
10+
value = 50
11+
12+
[angular_velocity_planet_rotation]
13+
value = 0
14+
15+
[idealized_ocean_albedo]
16+
value = 0.07
17+
18+
[mean_sea_level_pressure]
19+
value = 101480
20+
21+
[D_0_diffusion]
22+
value = 5
23+
24+
[H_diffusion]
25+
value = 800
26+
27+
[SST_mean]
28+
value = 300
29+
30+
[SST_delta]
31+
value = 1.25
32+
33+
[SST_wavelength]
34+
value = 6e6

0 commit comments

Comments
 (0)