Skip to content
Draft
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
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NumericalEarth"
uuid = "904d977b-046a-4731-8b86-9235c0d1ef02"
license = "MIT"
version = "0.8.2"
version = "0.9.0"
authors = ["NumericalEarth contributors"]

[workspace]
Expand Down Expand Up @@ -79,10 +79,10 @@ NumericalEarthZarrExt = "Zarr"
Accessors = "0.1.44"
Adapt = "4"
ArchGDAL = "0.10"
Breeze = "0.12"
Breeze = "0.13"
CDSAPI = "2.2.1"
CFTime = "0.1, 0.2"
ClimaSeaIce = "0.5.12, 0.6"
ClimaSeaIce = "0.6"
CondaPkg = "0.2.33"
ConservativeRegridding = "0.2"
CopernicusClimateDataStore = "0.2.2"
Expand All @@ -107,7 +107,7 @@ NCDatasets = "0.12, 0.13, 0.14"
NaturalEarth = "0.1"
NetworkOptions = "1"
OceanBioME = "0.19.1, 0.20"
Oceananigans = "0.112, 0.113, 0.114"
Oceananigans = "0.116"
OffsetArrays = "1.14"
PrecompileTools = "1"
PythonCall = "0.9.28"
Expand Down
5 changes: 3 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ Terrarium = "80418d68-07fa-499d-ae2b-c12e531f5cd8"

[sources]
NumericalEarth = {path = ".."}
Breeze = {url = "https://github.com/NumericalEarth/Breeze.jl", rev = "glw/oceananigans-0.116"} # TODO: remove once Breeze 0.13 is registered

[compat]
ArchGDAL = "0.10"
Breeze = "0.12"
Breeze = "0.13"
CUDA = "6"
CairoMakie = "0.15"
ConservativeRegridding = "0.2"
Documenter = "1"
DocumenterCitations = "1.3"
Enzyme = "0.13.166"
Literate = "2.2"
Oceananigans = "0.113, 0.114"
Oceananigans = "0.116"
Reactant = "0.2.278"
SpeedyWeather = "0.23"
Terrarium = "0.1.8"
5 changes: 3 additions & 2 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Terrarium = "80418d68-07fa-499d-ae2b-c12e531f5cd8"

[sources]
NumericalEarth = {path = ".."}
Breeze = {url = "https://github.com/NumericalEarth/Breeze.jl", rev = "glw/oceananigans-0.116"} # TODO: remove once Breeze 0.13 is registered

[compat]
Breeze = "0.12"
Breeze = "0.13"
CopernicusClimateDataStore = "0.2"
CUDA = "6"
CairoMakie = "0.15"
Oceananigans = "0.113, 0.114"
Oceananigans = "0.116"
8 changes: 4 additions & 4 deletions ext/NumericalEarthBreezeExt/breeze_nested_atmosphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using Oceananigans.Fields: AbstractField, interior, interpolate!
using Oceananigans.Forcings: Relaxation, FieldTimeSeriesTarget
using Oceananigans.Grids: znode, minimum_xspacing, x_domain, y_domain
using Oceananigans.Grids: OrthogonalSphericalShellGrid
using Oceananigans.OrthogonalSphericalShellGrids: LambertConformalConicGrid, lcc_forward
using Oceananigans.OrthogonalSphericalShellGrids: ConformalConicGrid, geographic_to_conformal_conic
using Oceananigans.TurbulenceClosures: closure_required_tracers
using Oceananigans.TimeSteppers: update_state!
using Oceananigans.Units: Time
Expand Down Expand Up @@ -170,15 +170,15 @@ end

# On a Lambert-conformal child the walls are lines of constant projected x or y, so the distance to the
# nearest wall is measured in the projection.
function boundary_relaxation_mask(grid::LambertConformalConicGrid, width; ramp = SmoothStepRamp())
function boundary_relaxation_mask(grid::ConformalConicGrid, width; ramp = SmoothStepRamp())
map = grid.conformal_mapping
Nx, Ny, _ = size(grid)
x₁, y₁ = map.x₁, map.y₁
x₂ = x₁ + Nx * map.Δx
y₂ = y₁ + Ny * map.Δy
w = width * max(map.Δx, map.Δy)
return (λ, φ, z) -> begin
x, y = lcc_forward(map, λ, φ)
x, y = geographic_to_conformal_conic(map, λ, φ)
d = min(x - x₁, x₂ - x, y - y₁, y₂ - y)
s = clamp(d / w, zero(d), one(d))
return oftype(d, ramp(s))
Expand All @@ -187,7 +187,7 @@ end

# Only the Lambert-conformal mapping carries a projected plane to measure the wall distance in.
boundary_relaxation_mask(grid::OrthogonalSphericalShellGrid, width; ramp = SmoothStepRamp()) =
throw(ArgumentError("boundary_relaxation_mask requires a LambertConformalConicGrid or a LatitudeLongitudeGrid, got a $(nameof(typeof(grid.conformal_mapping))) mapping"))
throw(ArgumentError("boundary_relaxation_mask requires a ConformalConicGrid or a LatitudeLongitudeGrid, got a $(nameof(typeof(grid.conformal_mapping))) mapping"))

# Cubic-ramp (smoothstep) Rayleigh mask over the top `depth` metres of the domain, for the ρw lid sponge.
# `z_top` is read once host-side under `@allowscalar`: a `znode` on a terrain-following GPU grid
Expand Down
2 changes: 1 addition & 1 deletion src/Bathymetry/Bathymetry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using Oceananigans.DistributedComputations: DistributedComputations, Distributed
reconstruct_global_grid, all_reduce
using Oceananigans.Fields: Field, interior, interpolate!
using Oceananigans.Grids: x_domain, y_domain, topology, λnode, φnode, Face, Center,
Flat, Periodic, Bounded, LeftConnected, RightConnected,
Flat, Periodic, Bounded, Sides, Closed,
RectilinearGrid, LatitudeLongitudeGrid, OrthogonalSphericalShellGrid,
λnodes, φnodes
using Oceananigans.ImmersedBoundaries: ImmersedBoundaryGrid
Expand Down
8 changes: 3 additions & 5 deletions src/Bathymetry/smooth_topography.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using DocStringExtensions: TYPEDSIGNATURES

# RightConnected and LeftConnected have physical west and east boundaries, respectively.
@inline _previous_smoothing_index(i, ::Bounded) = max(1, i - 1)
@inline _previous_smoothing_index(i, ::RightConnected) = max(1, i - 1)
# Clamp to the interior across a physical (Closed) boundary.
@inline _previous_smoothing_index(i, ::Sides{Closed}) = max(1, i - 1)
@inline _previous_smoothing_index(i, ::Flat) = i
@inline _previous_smoothing_index(i, topology) = i - 1

@inline _next_smoothing_index(i, N, ::Bounded) = min(N, i + 1)
@inline _next_smoothing_index(i, N, ::LeftConnected) = min(N, i + 1)
@inline _next_smoothing_index(i, N, ::Sides{<:Any, Closed}) = min(N, i + 1)
@inline _next_smoothing_index(i, N, ::Flat) = i
@inline _next_smoothing_index(i, N, topology) = i + 1

Expand Down
4 changes: 2 additions & 2 deletions src/EarthSystemModels/earth_system_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ grid = LatitudeLongitudeGrid(GPU();
z = (-100, 0),
latitude = (-80, 80),
longitude = (0, 360),
halo = (6, 6, 3))
halo = (6, 6, 4))

ocean = ocean_simulation(grid, closure=nothing)
set!(ocean.model, T=20, S=35, u=0.01, v=-0.005)
Expand Down Expand Up @@ -420,7 +420,7 @@ grid = LatitudeLongitudeGrid(size = (20, 20, 4),
z = (-100, 0),
latitude = (-80, 80),
longitude = (0, 360),
halo = (6, 6, 3))
halo = (6, 6, 4))

ocean = ocean_simulation(grid, closure=nothing)
set!(ocean.model, T=20, S=35, u=0.01, v=-0.005)
Expand Down
7 changes: 4 additions & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[sources]
NumericalEarth = {path = ".."}
Breeze = {url = "https://github.com/NumericalEarth/Breeze.jl", rev = "glw/oceananigans-0.116"} # TODO: remove once Breeze 0.13 is registered

[compat]
ArchGDAL = "0.10"
Breeze = "0.12"
Breeze = "0.13"
CDSAPI = "2.2.2"
CFTime = "0.1, 0.2"
CUDA = "5.9.5, 6"
ClimaSeaIce = "0.5, 0.6"
ClimaSeaIce = "0.6"
CondaPkg = "0.2.33"
ConservativeRegridding = "0.2"
CopernicusClimateDataStore = "0.2"
Expand All @@ -60,7 +61,7 @@ JLD2 = "0.4, 0.5, 0.6"
KernelAbstractions = "0.9"
MPI = "0.20"
NCDatasets = "0.12, 0.13, 0.14"
Oceananigans = "0.113, 0.114"
Oceananigans = "0.116"
OceanBioME = "0.19.1, 0.20"
Profile = "<0.0.1, 1"
PythonCall = "0.9.28"
Expand Down
2 changes: 1 addition & 1 deletion test/test_clock_consistency.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using NumericalEarth.Oceans: PrescribedOcean, SlabOcean
z = (-100, 0),
latitude = (-80, 80),
longitude = (0, 360),
halo = (6, 6, 3))
halo = (6, 6, 4))

model_clock = Clock{Float64}(time=0)

Expand Down
4 changes: 2 additions & 2 deletions test/test_nested_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ end
@testset "Boundary relaxation mask and parent region follow a Lambert-conformal child's walls on $(arch)" for arch in test_architectures
ext = Base.get_extension(NumericalEarth, :NumericalEarthBreezeExt)
Nx, Ny, width = 40, 30, 5
grid = LambertConformalConicGrid(arch; size = (Nx, Ny, 2), center = (-97.5, 38.5), spacing = 13e3,
standard_parallel = 38.5, z = (0, 1))
grid = ConformalConicGrid(arch; size = (Nx, Ny, 2), center = (-97.5, 38.5), spacing = 13e3,
standard_parallel = 38.5, z = (0, 1))

mask = CenterField(grid)
set!(mask, ext.boundary_relaxation_mask(grid, width))
Expand Down
4 changes: 2 additions & 2 deletions test/test_prescribed_atmosphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ end
@testset "Prescribed atmosphere tracers at any horizontal location" begin
for arch in test_architectures
atmosphere_grid = LatitudeLongitudeGrid(arch; size = (8, 8, 1), longitude = (0, 90), latitude = (-40, 40), z = (0, 1))
grid = LatitudeLongitudeGrid(arch; size = (10, 12, 1), longitude = (10, 80), latitude = (-30, 30), z = (-100, 0), halo = (6, 6, 3))
grid = LatitudeLongitudeGrid(arch; size = (10, 12, 1), longitude = (10, 80), latitude = (-30, 30), z = (-100, 0), halo = (6, 6, 4))

# Tracers have their own time axis, twice as long as the atmosphere's
function linear_tracer(LX, LY, f)
Expand Down Expand Up @@ -159,7 +159,7 @@ end

@testset "Prescribed atmosphere fields on their own time axes" begin
for arch in test_architectures
grid = LatitudeLongitudeGrid(arch; size = (10, 10, 1), longitude = (10, 20), latitude = (30, 40), z = (-100, 0), halo = (6, 6, 3))
grid = LatitudeLongitudeGrid(arch; size = (10, 10, 1), longitude = (10, 20), latitude = (30, 40), z = (-100, 0), halo = (6, 6, 4))

# Rain is sampled half an interval before the other fields, as ERA5 accumulations are
rain_times = [-1800, 1800.0]
Expand Down
2 changes: 1 addition & 1 deletion test/test_river_routing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ end
longitude = (-10, 10),
latitude = (-10, 10),
z = (-100, 0),
halo = (7, 7, 4))
halo = (7, 7, 5))

bottom_height(λ, φ) = ifelse(λ < 0, -100, 10)
target_grid = ImmersedBoundaryGrid(underlying, GridFittedBottom(bottom_height))
Expand Down
4 changes: 2 additions & 2 deletions test/test_tracer_budget.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include("runtests_setup.jl")
using CUDA: @allowscalar
using Oceananigans.AbstractOperations: KernelFunctionOperation
using Oceananigans.Diagnostics: NaNChecker, nan_detected
using Oceananigans.Grids: MutableVerticalDiscretization
using Oceananigans.Grids: MutableVerticalDiscretization, RightCenterFolded, RightFaceFolded
using Oceananigans.Operators: volume
using Oceananigans.Units
using NumericalEarth.Oceans: get_radiative_forcing
Expand Down Expand Up @@ -100,7 +100,7 @@ end
underlying_grid = TripolarGrid(arch;
size = (20, 20, 20),
z,
halo = (7, 7, 4),
halo = (7, 7, 5),
fold_topology)

bottom_height = synthetic_bottom_height(underlying_grid;
Expand Down
Loading