Skip to content

Commit a4e8d62

Browse files
committed
ft: rcemipii vertical mesh
1 parent 1f322e8 commit a4e8d62

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

config/default_configs/default_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ z_elem:
2727
z_max:
2828
help: "Model top height. Default: 30km"
2929
value: 30000.0
30+
vertical_mesh:
31+
help: "Predefined vertical mesh [`~` (default), `rcemipii`]"
32+
value: ~
3033
vorticity_hyperdiffusion_coefficient:
3134
help: "Hyperdiffusion coefficient for vorticity (m s-1)"
3235
value: 0.1857

config/model_configs/rcemipii_box_CRM_1M.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,37 @@ config: box
77
rad: allskywithclear
88
approximate_linear_solve_iters: 2 # only valid when implicit_diffusion=true
99
rayleigh_sponge: true # set sponge level in toml file
10-
smagorinsky_lilly: "UV"
10+
11+
# Diffusion
12+
hyperdiff: "false"
1113
implicit_diffusion: true
14+
# smagorinsky_lilly: "UV_W" # horizontal + vertical
15+
smagorinsky_lilly: "UV" # horizontal
16+
vert_diff: "DecayWithHeightDiffusion" # vertical
1217

1318
reproducibility_test: true
1419

15-
# Reference diffusion setup
16-
vert_diff: "DecayWithHeightDiffusion"
17-
hyperdiff: "false"
18-
1920
# microphysics
21+
### 0M+Equil option
22+
# moist: equil
23+
# precip_model: 0M
2024
### !! 1M and 2M !!
2125
cloud_model: grid_scale # Ultimately wanted when `moist: nonequil`
2226
moist: nonequil
2327
precip_model: 1M
28+
2429
### spatial discretization ###
25-
x_max: 96000.0 # 96km
26-
y_max: 96000.0 # 96km
27-
# x_max: 6000000.0 # 6000km
28-
# y_max: 400000.0 # 400km
29-
z_max: 30000.0 # 30km
3030
nh_poly: 3 # hor. poly deg -> # quad pts in 1D in a h. elem is Nq = nh + 1
31-
# z_elem: 43 # Note: Set sponge height (`zd_viscous`) in toml file to cover top ~5 points
32-
z_elem: 86
33-
dz_bottom: 30.0
31+
## RCE_small
32+
x_max: 96000 # 96km
33+
y_max: 96000 # 96km
34+
## RCE_large
35+
# x_max: 6000000 # 6000km
36+
# y_max: 400000 # 400km
37+
## Vertical mesh
38+
z_max: 33000 # 33km
39+
z_elem: 74
40+
vertical_mesh: rcemipii
3441

3542
#~8km grid
3643
x_elem: 4

src/simulation/grids.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ClimaCore: Geometry, Hypsography, Fields, Spaces, Meshes, Grids, CommonGrids
1+
import ClimaCore: Geometry, Hypsography, Fields, Spaces, Meshes, Grids, CommonGrids, Domains
22
using ClimaUtilities: SpaceVaryingInputs.SpaceVaryingInput
33
import .AtmosArtifacts as AA
44
import ClimaComms
@@ -167,14 +167,27 @@ function BoxGrid(
167167
topography_damping_factor = 5.0,
168168
mesh_warp_type::MeshWarpType = LinearWarp(),
169169
topo_smoothing = false,
170+
vertical_mesh = nothing,
170171
) where {FT}
171172
n_quad_points = nh_poly + 1
172173
stretch =
173174
z_stretch ? Meshes.HyperbolicTangentStretching{FT}(dz_bottom) : Meshes.Uniform()
174175
hypsography_fun = hypsography_function_from_topography(
175176
FT, topography, topography_damping_factor, mesh_warp_type, topo_smoothing,
176177
)
177-
z_mesh = CommonGrids.DefaultZMesh(FT; z_min = 0, z_max, z_elem, stretch)
178+
z_mesh = if vertical_mesh == "rcemipii"
179+
boundary_layer =
180+
FT[0, 37, 112, 194, 288, 395, 520, 667, 843, 1062, 1331, 1664, 2055, 2505]
181+
n_bl = length(boundary_layer) - 1
182+
free_atmosphere = range(3000, FT(z_max), length = z_elem - n_bl) # z_elem=74, z_max=33_000m --> 500m spacing
183+
CT = Geometry.ZPoint{FT}
184+
faces = CT.([boundary_layer; free_atmosphere])
185+
z_domain =
186+
Domains.IntervalDomain(CT(0), CT(z_max); boundary_names = (:bottom, :top))
187+
Meshes.IntervalMesh(z_domain, faces)
188+
else
189+
CommonGrids.DefaultZMesh(FT; z_min = 0, z_max, z_elem, stretch)
190+
end
178191
grid = CommonGrids.Box3DGrid(
179192
FT;
180193
z_elem, x_min = 0, x_max, y_min = 0, y_max, z_min = 0, z_max,

src/solver/type_getters.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ function get_grid(parsed_args, params, context)
764764
z_max = parsed_args["z_max"],
765765
z_stretch = parsed_args["z_stretch"],
766766
dz_bottom = parsed_args["dz_bottom"],
767+
vertical_mesh = parsed_args["vertical_mesh"],
767768
)
768769

769770
# Add topography parameters for non-column grids

0 commit comments

Comments
 (0)