Skip to content

Commit af11299

Browse files
authored
Patch required for Oceananigans >=0.97.4 (#588)
* patch required for Oceananigans >=0.97.4 * more instantiated locs for FieldBoundaryCondition * fixes * try add CondaPkg.toml * try add installing copernicusmarine via pip * revert ClimaSeaIce * drop CondaPkg completely? * drop CondaPkg completely? * undo CondaPkg-related changes * undo CondaPkg-related changes * remove stray line * Update Project.toml * add CondaPkg.toml to resolve python incompatibilites with ReactantPythonCallExt and ClimaOceanPythonCallExt * update zenodo ref * require ClimaSeaIce >= 0.3.3
1 parent c1cc8f5 commit af11299

File tree

9 files changed

+21
-14
lines changed

9 files changed

+21
-14
lines changed

CondaPkg.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
[pip.deps]
3+
copernicusmarine = ">=2.0.0"
4+
xarray = ">=2024.7.0"
5+
numpy = ">=2.0.0"
6+
jax = ">=0.6"
7+
tensorflow = ">=2.17"

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "ClimaOcean"
22
uuid = "0376089a-ecfe-4b0e-a64f-9c555d74d754"
33
license = "MIT"
44
authors = ["Climate Modeling Alliance and contributors"]
5-
version = "0.8.0"
5+
version = "0.8.1"
66

77
[deps]
88
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -44,7 +44,7 @@ ClimaOceanReactantExt = "Reactant"
4444
Adapt = "4"
4545
CFTime = "0.1, 0.2"
4646
CUDA = "4, 5"
47-
ClimaSeaIce = "0.3.1"
47+
ClimaSeaIce = "0.3.3"
4848
CondaPkg = "0.2.28"
4949
CubicSplines = "0.2"
5050
DataDeps = "0.7"
@@ -55,7 +55,7 @@ JLD2 = "0.4, 0.5"
5555
KernelAbstractions = "0.9"
5656
MPI = "0.20"
5757
NCDatasets = "0.12, 0.13, 0.14"
58-
Oceananigans = "0.97.3"
58+
Oceananigans = "0.97.4"
5959
OffsetArrays = "1.14"
6060
PrecompileTools = "1"
6161
PythonCall = "0.9"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Note that though ClimaOcean is currently focused on hydrostatic modeling with `O
105105
If you use ClimaOcean for your research, teaching, or fun 🤩, everyone in our community will be grateful
106106
if you give credit by citing the corresponding Zenodo record, e.g.,
107107

108-
> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.7.0 (v0.7.0). Zenodo. https://doi.org/10.5281/zenodo.7677442
108+
> Wagner, G. L. et al. (2025). CliMA/ClimaOcean.jl: v0.8.1 (v0.8.1). Zenodo. https://doi.org/10.5281/zenodo.7677442
109109
110110
and also the recent [preprint submitted to the Journal of Advances in Modeling Earth Systems](https://arxiv.org/abs/2502.14148) that presents an overview of all the things that make Oceananigans unique:
111111

experiments/flux_climatology/flux_climatology.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ function PrescribedOcean(timeseries;
133133
Jᵀ = Field{Center, Center, Nothing}(grid)
134134
= Field{Center, Center, Nothing}(grid)
135135

136-
u = XFaceField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Face, Center, Center), top = FluxBoundaryCondition(τx)))
137-
v = YFaceField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center, Face, Center), top = FluxBoundaryCondition(τy)))
138-
T = CenterField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center, Center, Center), top = FluxBoundaryCondition(Jᵀ)))
139-
S = CenterField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center, Center, Center), top = FluxBoundaryCondition(Jˢ)))
136+
u = XFaceField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Face(), Center(), Center()), top = FluxBoundaryCondition(τx)))
137+
v = YFaceField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center(), Face(), Center()), top = FluxBoundaryCondition(τy)))
138+
T = CenterField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center(), Center(), Center()), top = FluxBoundaryCondition(Jᵀ)))
139+
S = CenterField(grid, boundary_conditions=FieldBoundaryConditions(grid, (Center(), Center(), Center()), top = FluxBoundaryCondition(Jˢ)))
140140

141141
PrescribedOcean(architecture(grid), grid, clock, (; u, v, w=ZeroField()), (; T, S), timeseries)
142142
end

ext/ClimaOceanPythonCallExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function download_dataset(meta::CopernicusMetadata, grid=nothing; skip_existing
3131
output_path = joinpath(output_directory, output_filename)
3232
isfile(output_path) && return output_path
3333

34-
toolbox = try
34+
toolbox = try
3535
pyimport("copernicusmarine")
3636
catch
3737
install_copernicusmarine()
@@ -97,4 +97,4 @@ function depth_bounds_kw(z)
9797
return (; minimum_depth, maximum_depth)
9898
end
9999

100-
end # module ClimaOceanPythonCallExt
100+
end # module ClimaOceanPythonCallExt

src/DataWrangling/JRA55/JRA55_field_time_series.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function JRA55FieldTimeSeries(metadata::JRA55Metadata, architecture=CPU(), FT=Fl
434434
latitude = φr,
435435
topology = (TX, Bounded, Flat))
436436

437-
boundary_conditions = FieldBoundaryConditions(JRA55_native_grid, (Center, Center, Nothing))
437+
boundary_conditions = FieldBoundaryConditions(JRA55_native_grid, (Center(), Center(), nothing))
438438
start_time = first_date(metadata.dataset, metadata.name)
439439
times = native_times(metadata; start_time)
440440

src/DataWrangling/metadata_field_time_series.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function FieldTimeSeries(metadata::Metadata, grid::AbstractGrid;
120120

121121
times = native_times(metadata)
122122
loc = LX, LY, LZ = location(metadata)
123-
boundary_conditions = FieldBoundaryConditions(grid, loc)
123+
boundary_conditions = FieldBoundaryConditions(grid, instantiate.(loc))
124124
fts = FieldTimeSeries{LX, LY, LZ}(grid, times; backend, time_indexing, boundary_conditions)
125125
set!(fts)
126126

src/Diagnostics/mixed_layer_depth.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MixedLayerDepthField = Field{<:Any, <:Any, <:Any, <:MixedLayerDepthOperand
2121
"""
2222
function MixedLayerDepthField(bm, grid, tracers; difference_criterion=3e-5)
2323
operand = MixedLayerDepthOperand(bm, grid, tracers; difference_criterion)
24-
loc = (Center, Center, Nothing)
24+
loc = (Center(), Center(), nothing)
2525
indices = (:, :, :)
2626
bcs = FieldBoundaryConditions(grid, loc)
2727
data = new_data(grid, loc, indices)

test/runtests_setup.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function test_setting_from_metadata(arch, dataset, start_date, inpainting,
3939
longitude = (10, 15),
4040
z = (-200, 0))
4141

42-
field = Field(loc, grid)
42+
field = Field{loc...}(grid)
4343

4444
@test begin
4545
for name in names

0 commit comments

Comments
 (0)