-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2055 from CliMA/ck/HF_datalayouts
Add HF datalayouts
- Loading branch information
Showing
51 changed files
with
2,471 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using ClimaCorePlots, Plots | ||
using ClimaCore.DataLayouts | ||
|
||
include("baroclinic_wave_utilities.jl") | ||
|
||
const sponge = false | ||
|
||
# Variables required for driver.jl (modify as needed) | ||
horizontal_mesh = cubed_sphere_mesh(; radius = R, h_elem = 4) | ||
npoly = 4 | ||
z_max = FT(30e3) | ||
z_elem = 10 | ||
t_end = FT(60 * 60 * 24 * 10) | ||
dt = FT(400) | ||
dt_save_to_sol = FT(60 * 60 * 24) | ||
dt_save_to_disk = FT(0) # 0 means don't save to disk | ||
ode_algorithm = CTS.SSP333 | ||
jacobian_flags = (; ∂ᶜ𝔼ₜ∂ᶠ𝕄_mode = :no_∂ᶜp∂ᶜK, ∂ᶠ𝕄ₜ∂ᶜρ_mode = :exact) | ||
|
||
additional_cache(ᶜlocal_geometry, ᶠlocal_geometry, dt) = merge( | ||
hyperdiffusion_cache(ᶜlocal_geometry, ᶠlocal_geometry; κ₄ = FT(2e17)), | ||
sponge ? rayleigh_sponge_cache(ᶜlocal_geometry, ᶠlocal_geometry, dt) : (;), | ||
) | ||
function additional_tendency!(Yₜ, Y, p, t) | ||
hyperdiffusion_tendency!(Yₜ, Y, p, t) | ||
sponge && rayleigh_sponge_tendency!(Yₜ, Y, p, t) | ||
end | ||
|
||
center_initial_condition(local_geometry) = | ||
center_initial_condition(local_geometry, Val(:ρe)) | ||
function postprocessing(sol, output_dir) | ||
@info "L₂ norm of ρe at t = $(sol.t[1]): $(norm(sol.u[1].c.ρe))" | ||
@info "L₂ norm of ρe at t = $(sol.t[end]): $(norm(sol.u[end].c.ρe))" | ||
|
||
anim = Plots.@animate for Y in sol.u | ||
ᶜv = Geometry.UVVector.(Y.c.uₕ).components.data.:2 | ||
Plots.plot(ᶜv, level = 3, clim = (-6, 6)) | ||
end | ||
Plots.mp4(anim, joinpath(output_dir, "v.mp4"), fps = 5) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.