Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config and update spaces to use SLEVE coords (optional) with topography #2741

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .buildkite/longruns_gpu/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ steps:
slurm_time: 12:00:00
env:
JOB_NAME: "longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_0M_earth"

- label: ":computer: aquaplanet equilmoist clearsky radiation + 0M microphysics + earth topography (SLEVE)"
command:
- srun julia --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/$$JOB_NAME.yml
artifact_paths: "$$JOB_NAME/*"
agents:
slurm_gpus: 1
slurm_time: 6:00:00
env:
JOB_NAME: "longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_0M_earth_sleve"

- group: "DYAMOND"

Expand Down
9 changes: 9 additions & 0 deletions config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ scalar_hyperdiffusion_coefficient:
topography:
help: "Define the surface elevation profile [`NoWarp`,`Earth`,`DCMIP200`,`Agnesi`]"
value: "NoWarp"
mesh_warp_type:
help: "Sets the interior mesh warp method [`Linear`, `SLEVE`]"
value: "Linear"
sleve_eta:
help: "If SLEVE coordinates are chosen, sets the `ηₕ` parameter (if z/z_top > ηₕ, no warping is applied)"
value: 0.7
sleve_s:
help: "If SLEVE coordinates are chosen, sets `s`, the warping decay scale parameter"
value: 10.0
topo_smoothing:
help: "Choose whether to order-2 smoothing on the LGL mesh"
value: false
Expand Down
akshaysridhar marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dt_save_state_to_disk: "10days"
dt: "100secs"
rad: "clearsky"
dt_rad: "6hours"
t_end: "200days"
dz_bottom: 30.0
dz_top: 3000.0
h_elem: 16
z_elem: 63
z_max: 55000.0
job_id: "longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_0M_earth_sleve"
moist: "equil"
precip_model: "0M"
rayleigh_sponge: true
vorticity_hyperdiffusion_coefficient: 3.0
divergence_damping_factor: 1.0
scalar_hyperdiffusion_coefficient: 3.0
smoothing_order: 2
topo_smoothing: true
mesh_warp_type: "SLEVE"
topography: "Earth"
surface_setup: "DefaultMoninObukhov"
vert_diff: "FriersonDiffusion"
implicit_diffusion: true
approximate_linear_solve_iters: 2
toml: [toml/longrun_aquaplanet_rhoe_equil_55km_nz63_clearsky_0M_earth_sleve.toml]
6 changes: 4 additions & 2 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ function get_spaces(parsed_args, params, comms_ctx)
z_max,
z_elem,
z_stretch;
parsed_args = parsed_args,
surface_warp = warp_function,
topo_smoothing = parsed_args["topo_smoothing"],
deep,
)
end
Expand All @@ -216,7 +216,7 @@ function get_spaces(parsed_args, params, comms_ctx)
else
Meshes.Uniform()
end
make_hybrid_spaces(h_space, z_max, z_elem, z_stretch)
make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args)
elseif parsed_args["config"] == "box"
FT = eltype(params)
nh_poly = parsed_args["nh_poly"]
Expand All @@ -243,6 +243,7 @@ function get_spaces(parsed_args, params, comms_ctx)
z_max,
z_elem,
z_stretch;
parsed_args,
surface_warp = warp_function,
deep,
)
Expand All @@ -266,6 +267,7 @@ function get_spaces(parsed_args, params, comms_ctx)
z_max,
z_elem,
z_stretch;
parsed_args,
surface_warp = warp_function,
deep,
)
Expand Down
16 changes: 15 additions & 1 deletion src/utils/common_spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ function make_hybrid_spaces(
surface_warp = nothing,
topo_smoothing = false,
deep = false,
parsed_args = nothing,
)
FT = eltype(z_max)
# TODO: change this to make_hybrid_grid
h_grid = Spaces.grid(h_space)
z_domain = Domains.IntervalDomain(
Expand All @@ -101,11 +103,23 @@ function make_hybrid_spaces(
if isnothing(surface_warp)
hypsography = Hypsography.Flat()
else
topo_smoothing = parsed_args["topo_smoothing"]
z_surface = surface_warp(Fields.coordinate_field(h_space))
if topo_smoothing
Hypsography.diffuse_surface_elevation!(z_surface)
end
hypsography = Hypsography.LinearAdaption(Geometry.ZPoint.(z_surface))
if parsed_args["mesh_warp_type"] == "SLEVE"
@info "SLEVE mesh warp"
hypsography = Hypsography.SLEVEAdaption(
z_surface,
parsed_args["sleve_eta"],
parsed_args["sleve_s"],
)
elseif parsed_args["mesh_warp_type"] == "Linear"
@info "Linear mesh warp"
hypsography =
Hypsography.LinearAdaption(Geometry.ZPoint.(z_surface))
end
end
grid = Grids.ExtrudedFiniteDifferenceGrid(h_grid, z_grid, hypsography; deep)
# TODO: return the grid
Expand Down
5 changes: 5 additions & 0 deletions test/gravity_wave/orographic_gravity_wave/ogwd_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ include("../../../post_processing/remap/remap_helpers.jl")
include("../gw_plotutils.jl")

comms_ctx = ClimaComms.SingletonCommsContext()
test_args = ClimaAtmos.cli_defaults(CA.argparse_settings())
config_dict = Dict("topo_smoothing" => false, "mesh_warp_type" => "Linear")
parsed_args = CA.AtmosConfig(config_dict).parsed_args

# load gfdl data
include(joinpath(pkgdir(ClimaAtmos), "artifacts", "artifact_funcs.jl"))
Expand Down Expand Up @@ -100,12 +103,14 @@ quad = Quadratures.GLL{nh_poly + 1}()
horizontal_mesh = CA.cubed_sphere_mesh(; radius, h_elem)
h_space = CA.make_horizontal_space(horizontal_mesh, quad, comms_ctx, false)


z_stretch = Meshes.GeneralizedExponentialStretching(dz_bottom, dz_top)
center_space, face_space = CA.make_hybrid_spaces(
h_space,
z_max,
z_elem,
z_stretch;
parsed_args,
surface_warp = warp_function,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[alpha_rayleigh_w]
value = 10.0
type = "float"

[zd_rayleigh]
value = 35000.0

[alpha_rayleigh_uh]
alias = "alpha_rayleigh_uh"
value = 0.0
Loading