Skip to content
Open
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
636 changes: 315 additions & 321 deletions .buildkite/pipeline.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ClimaCoupler.jl Release Notes

### ClimaCoupler features

#### Use TripolarGrid with OceananigansSimulation PR[#1409](https://github.com/CliMA/ClimaCoupler.jl/pull/1409)
Switch from using the Oceananigans.jl `LatitudeLongitudeGrid` to `TripolarGrid`.

#### Update interfaces to surface-flux calculator to support dynamic roughness.
Adds the `roughness_model` argument to the surface-flux input constructor. Default
behaviour is the `SF.ScalarRoughness()` type. Upcoming changes will account for the
Expand Down
18 changes: 14 additions & 4 deletions experiments/ClimaEarth/Manifest-v1.11.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.11.5"
julia_version = "1.11.6"
manifest_format = "2.0"
project_hash = "f84997fb003cca7320c93d5448b91701d73e02c0"
project_hash = "3024d467f38603d16897d6c459df0a9b54427f0a"

[[deps.ADTypes]]
git-tree-sha1 = "8b2b045b22740e4be20654175cc38291d48539db"
Expand Down Expand Up @@ -449,9 +449,11 @@ weakdeps = ["CUDA", "MPI"]

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LazyBroadcast", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "UnrolledUtilities"]
git-tree-sha1 = "ca717446978d2815b4fa23a62a2131861e44d1e8"
git-tree-sha1 = "ecf3fd72077213622731dc76d45897b66f6aa55b"
repo-rev = "js/kp/conservative"
repo-url = "https://github.com/CliMA/ClimaCore.jl.git"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.14.42"
version = "0.14.43"
weakdeps = ["CUDA", "Krylov"]

[deps.ClimaCore.extensions]
Expand Down Expand Up @@ -689,6 +691,14 @@ git-tree-sha1 = "d9d26935a0bcffc87d2613ce14c527c99fc543fd"
uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb"
version = "2.5.0"

[[deps.ConservativeRegridding]]
deps = ["DocStringExtensions", "Extents", "GeoInterface", "GeometryOps", "GeometryOpsCore", "LinearAlgebra", "ProgressMeter", "SortTileRecursiveTree", "SparseArrays"]
git-tree-sha1 = "f6a18c6f306bbd3be1cca902fc995514a60a66ce"
repo-rev = "main"
repo-url = "https://github.com/JuliaGeo/ConservativeRegridding.jl"
uuid = "8e50ac2c-eb48-49bc-a402-07c87b949343"
version = "0.1.0"

[[deps.ConstructionBase]]
git-tree-sha1 = "b4b092499347b18a015186eae3042f72267106cb"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Expand Down
2 changes: 2 additions & 0 deletions experiments/ClimaEarth/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
ClimaSeaIce = "6ba0ff68-24e6-4315-936c-2e99227c95a4"
ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
ClimaUtilities = "b3f4f4ca-9299-4f7f-bd9b-81e1242a7513"
ConservativeRegridding = "8e50ac2c-eb48-49bc-a402-07c87b949343"
EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
Insolation = "e98cc03f-d57e-4e3c-b70c-8d51efe9e0d8"
Expand Down Expand Up @@ -50,6 +51,7 @@ ClimaUtilities = "0.1"
EnsembleKalmanProcesses = "2"
Insolation = "0.10.2"
Interpolations = "0.14, 0.15"
JLD2 = "0.4, 0.5, 0.6"
Oceananigans = "0.100"
StaticArrays = "1"
YAML = "0.4"
50 changes: 0 additions & 50 deletions experiments/ClimaEarth/components/ocean/climaocean_helpers.jl
Original file line number Diff line number Diff line change
@@ -1,44 +1,4 @@
"""
to_node(pt::CC.Geometry.LatLongPoint)

Transform `LatLongPoint` into a tuple (long, lat, 0), where the 0 is needed because we only
care about the surface.
"""
@inline to_node(pt::CC.Geometry.LatLongPoint) = pt.long, pt.lat, zero(pt.lat)
# This next one is needed if we have "LevelGrid"
@inline to_node(pt::CC.Geometry.LatLongZPoint) = pt.long, pt.lat, zero(pt.lat)

"""
map_interpolate(points, oc_field::OC.Field)

Interpolate the given 3D field onto the target points.

If the underlying grid does not contain a given point, return 0 instead.

Note: `map_interpolate` does not support interpolation from `Field`s defined on
`OrthogononalSphericalShellGrids` such as the `TripolarGrid`.

TODO: Use a non-allocating version of this function (simply replace `map` with `map!`)
"""
function map_interpolate(points, oc_field::OC.Field)
loc = map(L -> L(), OC.Fields.location(oc_field))
grid = oc_field.grid
data = oc_field.data

# TODO: There has to be a better way
min_lat, max_lat = extrema(OC.φnodes(grid, OC.Center(), OC.Center(), OC.Center()))

map(points) do pt
FT = eltype(pt)

# The oceananigans grid does not cover the entire globe, so we should not
# interpolate outside of its latitude bounds. Instead we return 0
min_lat < pt.lat < max_lat || return FT(0)

fᵢ = OC.Fields.interpolate(to_node(pt), data, loc, grid)
convert(FT, fᵢ)::FT
end
end

"""
surface_flux(f::OC.AbstractField)
Expand All @@ -54,16 +14,6 @@ function surface_flux(f::OC.AbstractField)
end
end

function Interfacer.remap(field::OC.Field, target_space)
return map_interpolate(CC.Fields.coordinate_field(target_space), field)
end

function Interfacer.remap(operation::OC.AbstractOperations.AbstractOperation, target_space)
evaluated_field = OC.Field(operation)
OC.compute!(evaluated_field)
return Interfacer.remap(evaluated_field, target_space)
end

"""
set_from_extrinsic_vector!(vector, grid, u_cc, v_cc)

Expand Down
Loading