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

Caching inpainting data + some updates to the one degree simulation #230

Merged
merged 38 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6adbbbf
Update compat
glwagner Nov 10, 2024
746b599
don't relax compass
navidcy Nov 10, 2024
4ac5f21
Update Project.toml
glwagner Nov 10, 2024
2736766
Update Project.toml
glwagner Nov 10, 2024
8545662
Update Project.toml
glwagner Nov 10, 2024
e148194
Generalize default free surface for IBG
glwagner Nov 10, 2024
9c3aa7e
Update Project.toml
navidcy Nov 10, 2024
ce7c116
use interior for max of field
navidcy Nov 10, 2024
f21a42b
Merge branch 'glw/more-one-degree' of github.com:CliMA/ClimaOcean.jl …
navidcy Nov 10, 2024
7509819
smaller Δt
navidcy Nov 10, 2024
b3913e9
Merge branch 'main' into glw/more-one-degree
navidcy Nov 10, 2024
d58fd5c
Merge branch 'main' into glw/more-one-degree
navidcy Nov 11, 2024
870e57a
Implement inpainting saving
glwagner Nov 11, 2024
adeddb5
Merge branch 'glw/more-one-degree' of https://github.com/CliMA/ClimaO…
glwagner Nov 11, 2024
854f5a8
Clean up
glwagner Nov 11, 2024
f6d4b48
Test inpainting caching
glwagner Nov 11, 2024
6d547ce
Update ECCO_field docstring
glwagner Nov 11, 2024
6b3ad97
Merge branch 'main' into glw/more-one-degree
glwagner Nov 12, 2024
b5c586f
Merge branch 'main' into glw/more-one-degree
navidcy Nov 12, 2024
7008439
Modify one degree simulation
Nov 13, 2024
13091c9
some more updates to the one degree simulation
simone-silvestri Nov 13, 2024
60b8a25
bugfix
simone-silvestri Nov 13, 2024
680f4b5
Merge remote-tracking branch 'origin/main' into glw/more-one-degree
simone-silvestri Nov 15, 2024
eef5a1b
cache inpainted data?
simone-silvestri Nov 15, 2024
c653299
ebugfix
simone-silvestri Nov 15, 2024
d1dd2f3
advancing
simone-silvestri Nov 15, 2024
b1ae2ae
small bug
simone-silvestri Nov 15, 2024
ccbe516
some bugfixes
simone-silvestri Nov 15, 2024
bccd3a8
add a `@root` to caching
simone-silvestri Nov 15, 2024
f1d3ced
open with read permission
simone-silvestri Nov 15, 2024
517782c
interpolate on grid beforehand
simone-silvestri Nov 15, 2024
3539660
fix minimum-seaice in the meantime
simone-silvestri Nov 15, 2024
235a67c
comment
simone-silvestri Nov 15, 2024
5c23b6e
trhow an error
simone-silvestri Nov 15, 2024
bcfc307
correct arch
simone-silvestri Nov 15, 2024
4c26acd
Merge remote-tracking branch 'origin/main' into glw/more-one-degree
glwagner Nov 18, 2024
88cc7e0
rm fake sea ice again
glwagner Nov 18, 2024
5715bf4
Make default true for caching
glwagner Nov 18, 2024
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Downloads = "1.6"
ImageMorphology = "0.4"
JLD2 = "0.4, 0.5"
KernelAbstractions = "0.9"
Oceananigans = "0.93.3 - 0.94"
OrthogonalSphericalShellGrids = "0.1.7"
navidcy marked this conversation as resolved.
Show resolved Hide resolved
NCDatasets = "0.12, 0.13, 0.14"
Oceananigans = "0.93.1"
OrthogonalSphericalShellGrids = "0.1.2"
Scratch = "1"
SeawaterPolynomials = "0.3.4"
StaticArrays = "1"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ CairoMakie = "0.10.12, 0.11, 0.12"
DataDeps = "0.7"
Documenter = "1"
Oceananigans = "0.93.1"
OrthogonalSphericalShellGrids = "0.1.7"
22 changes: 12 additions & 10 deletions experiments/one_degree_simulation/one_degree_simulation.jl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it worths renaming the file if we are gonna leave it as 3 degree horizontal resolution

Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ z = exponential_z_faces(Nz=30, depth=6000)
Nx = 120
Ny = 60
Nz = length(z) - 1

grid = TripolarGrid(arch; z, size = (Nx, Ny, Nz), north_poles_latitude=55, first_pole_longitude=70)

@show grid
grid = TripolarGrid(arch; z, size=(Nx, Ny, Nz))

bottom_height = regrid_bathymetry(grid;
minimum_depth = 10,
interpolation_passes = 5,
major_basins = 3)

grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bottom_height))

# Closure
gm = Oceananigans.TurbulenceClosures.IsopycnalSkewSymmetricDiffusivity(κ_skew=1000, κ_symmetric=1000)
catke = Oceananigans.TurbulenceClosures.CATKEVerticalDiffusivity()
Expand All @@ -45,7 +44,7 @@ set!(restoring_mask_field, restoring_mask)
Fu = Forcing(sponge_layer, field_dependencies=:u, parameters=restoring_rate)
Fv = Forcing(sponge_layer, field_dependencies=:v, parameters=restoring_rate)

dates = DateTimeProlepticGregorian(1993, 1, 1) : Month(1) : DateTimeProlepticGregorian(1994, 1, 1)
dates = DateTimeProlepticGregorian(1993, 11, 1) : Month(1) : DateTimeProlepticGregorian(1994, 11, 1)
temperature = ECCOMetadata(:temperature, dates, ECCO4Monthly())
salinity = ECCOMetadata(:salinity, dates, ECCO4Monthly())

Expand All @@ -68,17 +67,20 @@ atmosphere = JRA55_prescribed_atmosphere(arch; backend=JRA55NetCDFBackend(41))
sea_ice = ClimaOcean.OceanSeaIceModels.MinimumTemperatureSeaIce()
coupled_model = OceanSeaIceModel(ocean, sea_ice; atmosphere, radiation)

simulation = Simulation(coupled_model; Δt=1, stop_iteration=10)
simulation = Simulation(coupled_model; Δt=15minutes, stop_time=2*365days)

wall_time = Ref(time_ns())

function progress(sim)
ocean = sim.model.ocean
u, v, w = ocean.model.velocities
T = ocean.model.tracers.T
Tmax = maximum(T)
Tmin = minimum(T)
umax = maximum(abs, u), maximum(abs, v), maximum(abs, w)
Tmax = maximum(interior(T))
Tmin = minimum(interior(T))
umax = (maximum(abs, interior(u)),
maximum(abs, interior(v)),
maximum(abs, interior(w)))

step_time = 1e-9 * (time_ns() - wall_time[])

@info @sprintf("Time: %s, n: %d, Δt: %s, max|u|: (%.2e, %.2e, %.2e) m s⁻¹, extrema(T): (%.2f, %.2f) ᵒC, wall time: %s \n",
Expand All @@ -90,6 +92,6 @@ function progress(sim)
return nothing
end

add_callback!(simulation, progress, IterationInterval(1))
add_callback!(simulation, progress, IterationInterval(10))

run!(simulation)
1 change: 1 addition & 0 deletions src/DataWrangling/JRA55.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Oceananigans.OutputReaders: new_backend, update_field_time_series!
using Downloads: download

download_jra55_cache::String = ""

function __init__()
global download_jra55_cache = @get_scratch!("JRA55")
end
Expand Down
3 changes: 2 additions & 1 deletion src/OceanSimulations/OceanSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ default_free_surface(grid) = SplitExplicitFreeSurface(grid; cfl=0.7)

# 70 substeps is a safe rule of thumb for an ocean at 1/4 - 1/10th of a degree
# TODO: pass the cfl and a given Δt to calculate the number of substeps?
default_free_surface(grid::TripolarGrid) = SplitExplicitFreeSurface(grid; substeps = 70)
const TripolarOfSomeKind = Union{TripolarGrid, ImmersedBoundaryGrid{<:Any, <:Any, <:Any, <:Any, <:TripolarGrid}}
default_free_surface(grid::TripolarOfSomeKind) = SplitExplicitFreeSurface(grid; substeps=70)

function default_ocean_closure()
mixing_length = CATKEMixingLength(Cᵇ=0.01)
Expand Down
Loading