Skip to content

Commit

Permalink
Merge pull request #2941 from CliMA/as/hughes23-test
Browse files Browse the repository at this point in the history
Add topography option to support Hughes2023 double-mountain config
  • Loading branch information
akshaysridhar authored Dec 13, 2024
2 parents 96c8bdf + 35c6fac commit 3cc8b13
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ steps:
--config_file $CONFIG_PATH/sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth.yml
--job_id sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth
artifact_paths: "sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth/output_active/*"

- label: ":computer: Baroclinic wave (ρe) equilmoist (Hughes2023 double mountain config)"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
--config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_hughes2023.yml
--job_id sphere_baroclinic_wave_rhoe_hughes2023
artifact_paths: "sphere_baroclinic_wave_rhoe_hughes2023/output_active/*"

- group: "Restarting"
steps:
Expand Down
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ scalar_hyperdiffusion_coefficient:
value: 1.5
# Topography
topography:
help: "Define the surface elevation profile [`NoWarp`,`Earth`,`DCMIP200`,`Agnesi`]"
help: "Define the surface elevation profile [`NoWarp` (default),`Earth`,`DCMIP200`,`Agnesi`, `Schar`, `Hughes2023`]"
value: "NoWarp"
mesh_warp_type:
help: "Sets the interior mesh warp method [`Linear`, `SLEVE`]"
Expand Down
13 changes: 13 additions & 0 deletions config/model_configs/sphere_baroclinic_wave_rhoe_hughes2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dt_save_state_to_disk: "2days"
initial_condition: "MoistBaroclinicWave"
topography: "Hughes2023"
topo_smoothing: false
implicit_diffusion: true
approximate_linear_solve_iters: 2
moist: equil
dt: "200secs"
t_end: "10days"
vert_diff: "FriersonDiffusion"
diagnostics:
- short_name: [pfull, ua, wa, va, rv, pr, cli, hus, ke]
period: 1days
7 changes: 6 additions & 1 deletion post_processing/ci_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,13 @@ function make_plots(::DryBaroWavePlots, output_paths::Vector{<:AbstractString})
)
end

SphereOrographyPlots = Union{
Val{:sphere_baroclinic_wave_rhoe_topography_dcmip_rs},
Val{:sphere_baroclinic_wave_rhoe_hughes2023},
}

function make_plots(
::Val{:sphere_baroclinic_wave_rhoe_topography_dcmip_rs},
::SphereOrographyPlots,
output_paths::Vector{<:AbstractString},
)
simdirs = SimDir.(output_paths)
Expand Down
33 changes: 33 additions & 0 deletions src/topography/topography.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@ function topography_dcmip200(coords)
return zₛ
end

"""
topography_hughes2023(λ,ϕ)
λ = longitude (degrees)
ϕ = latitude (degrees)
Returns the surface elevation profile used in the baroclinic wave
test problem defined by Hughes and Jablonowski (2023).
"""
function topography_hughes2023(coords)
λ, ϕ = coords.long, coords.lat
FT = eltype(λ)
h₀ = FT(2e3)
# Angles in degrees
ϕ₁ = FT(45)
ϕ₂ = FT(45)
λ_min = minimum(λ)
λ₁ = FT(72)
λ₂ = FT(140)
λₘ = FT(7)
ϕₘ = FT(40)
d = ϕₘ / 2 * (-log(0.1))^(-1 / 6)
c = λₘ / 2 * (-log(0.1))^(-1 / 2)
d₁ = @.- λ_min) - λ₁
d₂ = @.- λ_min) - λ₂
l₁ = @. λ - λ₁
l₂ = @. λ - λ₂
zₛ = @. FT(
h₀ * (
exp(-(((ϕ - ϕ₁) / d)^6 + (l₁ / c)^2)) +
exp(-(((ϕ - ϕ₂) / d)^6 + (l₂ / c)^2))
),
)
end

"""
topography_agnesi(x,z)
x = horizontal coordinate [m]
Expand Down
6 changes: 5 additions & 1 deletion src/utils/common_spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function make_hybrid_spaces(
z_grid = Grids.FiniteDifferenceGrid(z_topology)

topography = parsed_args["topography"]
@assert topography in ("NoWarp", "DCMIP200", "Earth", "Agnesi", "Schar")
@assert topography in
("NoWarp", "DCMIP200", "Earth", "Agnesi", "Schar", "Hughes2023")
if topography == "DCMIP200"
z_surface = SpaceVaryingInput(topography_dcmip200, h_space)
@info "Computing DCMIP200 orography on spectral horizontal space"
Expand All @@ -110,6 +111,9 @@ function make_hybrid_spaces(
elseif topography == "Schar"
z_surface = SpaceVaryingInput(topography_schar, h_space)
@info "Computing Schar orography on spectral horizontal space"
elseif topography == "Hughes2023"
z_surface = SpaceVaryingInput(topography_hughes2023, h_space)
@info "Computing Hughes2023 orography on spectral horizontal space"
elseif topography == "Earth"
z_surface = SpaceVaryingInput(
AA.earth_orography_file_path(;
Expand Down

0 comments on commit 3cc8b13

Please sign in to comment.