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
748 changes: 374 additions & 374 deletions .buildkite/pipeline.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ docs/src/generated/
# Experiments
!experiments/ClimaEarth/**/Manifest.toml
!experiments/ClimaCore/**/Manifest.toml
experiments/ClimaEarth/.CondaPkg/*

# Output
output/
Expand Down
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`.

#### Use `update_turbulent_fluxes!` instead of `update_field!` for atmosphere PR[#1511](https://github.com/CliMA/ClimaCoupler.jl/pull/1511)
Instead of using an `update_field!` method that dispatches on `::Val{:turbulent_fluxes}`
to update turbulent fluxes in the atmosphere, we switch to using a function `update_turbulent_fluxes!`.
Expand Down
74 changes: 74 additions & 0 deletions docs/src/interfacer.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,80 @@ function update_field!(sim::AbstractSurfaceStub, ::Val{:surface_diffuse_albedo},
end
```

## Remapping interface

For component models that don't use ClimaCore Fields, some additional functions
must be extended to enable remapping between the component model's grid
and the boundary space of the coupled simulation. These are described below.

To regrid from a component model's grid to the boundary space, we can typically
use ClimaCore's Remapping module. Users may want to create a remapping object
containing both the ClimaCore.Remapping.Remapper object and scratch space to
reduce allocations during the remapping.
This has been done for the OceananigansSimulation in
`experiments/ClimaEarth/components/ocean/oceananigans.jl`.
This direction simply requires supplying a matrix of ClimaCore.Geometry.LatLongPoint
objects containing latitude/longitude pairs at each point of the source grid.

### `remap(field, target_space, remapper)`

Remap the given `field` onto the `target_space`. If the field is already
on the target space or a compatible one, it is returned unchanged.

For ClimaCore Fields, this function is implemented by default and does not require
a remapper object. Component models that use non-ClimaCore fields (such as Oceananigans)
must extend this function to provide a method that handles remapping from their
native field type to a ClimaCore Field on the target space.

!!! note "Performance"
The `remap` method allocates a new field and is not efficient for
performance-critical code. For better performance, use the in-place option
`remap!` instead.

**Signature:**
- `field`: The source field to be remapped
- `target_space`: The target space (typically the boundary space) onto which the field should be remapped
- `remapper`: An optional remapper object returned by `get_remapper_to_cc(sim)`. For ClimaCore Fields, this can be `nothing`.

**Returns:** A new field remapped onto the target space

### `remap!(target_field, source, remapper)`

Remap the given `source` field onto the `target_field` in place. This is
the preferred method for remapping when performance is important, as it avoids
allocating a new field.

For ClimaCore Fields, this function is implemented by default. Component models
that use non-ClimaCore fields must extend this function to provide a method that
handles remapping from their native field type into the provided `target_field`.

**Signature:**
- `target_field`: The destination field (must be a ClimaCore Field) where remapped data will be stored
- `source`: The source field to be remapped (can be a ClimaCore Field or a non-ClimaCore field type)
- `remapper`: An optional remapper object returned by `get_remapper_to_cc(sim)`. For ClimaCore Fields, this can be `nothing`.

**Returns:** `nothing` (updates `target_field` in place)

### `get_remapper_to_cc(sim::ComponentModelSimulation)`

Return the remapper object used to remap quantities from this component model's grid
onto the boundary space.

By default, this function returns `nothing`, which is intended for use with components that
use the default remapping functions (i.e. components using ClimaCore Fields).
Components that require an alternative remapper (such as the XESMF regridder for Oceananigans)
should extend this function to return their remapper object. If this function is extended,
the component model will also need to extend `remap` and `remap!` to use the remapper object.

**Signature:**
- `sim`: The component model simulation

**Returns:** A remapper object (or `nothing` for ClimaCore-based models)

**Example:** For an Oceananigans simulation, this returns a NamedTuple containing an
XESMF regridder object with an initialized weight matrix, as well as scratch space
to be used during remapping.

## Interfacer API
```@docs
ClimaCoupler.Interfacer.CoupledSimulation
Expand Down
57 changes: 56 additions & 1 deletion experiments/ClimaEarth/Manifest-v1.11.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.6"
manifest_format = "2.0"
project_hash = "bf902fbe4cdfe69d6bdc0c99b12a9c00c5aa28ee"
project_hash = "4aefcc1c61d8db91f115838c0af8a131cde73b99"

[[deps.ADTypes]]
git-tree-sha1 = "27cecae79e5cc9935255f90c53bb831cc3c870d7"
Expand Down Expand Up @@ -689,6 +689,12 @@ git-tree-sha1 = "d9d26935a0bcffc87d2613ce14c527c99fc543fd"
uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb"
version = "2.5.0"

[[deps.CondaPkg]]
deps = ["JSON3", "Markdown", "MicroMamba", "Pidfile", "Pkg", "Preferences", "Scratch", "TOML", "pixi_jll"]
git-tree-sha1 = "bd491d55b97a036caae1d78729bdb70bf7dababc"
uuid = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
version = "0.2.33"

[[deps.ConstructionBase]]
git-tree-sha1 = "b4b092499347b18a015186eae3042f72267106cb"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Expand Down Expand Up @@ -2088,6 +2094,12 @@ version = "1.5.0"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"

[[deps.MicroMamba]]
deps = ["Pkg", "Scratch", "micromamba_jll"]
git-tree-sha1 = "011cab361eae7bcd7d278f0a7a00ff9c69000c51"
uuid = "0b3b1443-0f03-428d-bdfb-f27f9c1191ea"
version = "0.1.14"

[[deps.MicrosoftMPI_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bc95bf4149bf535c09602e3acdf950d9b4376227"
Expand Down Expand Up @@ -2413,6 +2425,12 @@ git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.8.3"

[[deps.Pidfile]]
deps = ["FileWatching", "Test"]
git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03"
uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307"
version = "1.3.0"

[[deps.Pixman_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl"]
git-tree-sha1 = "db76b1ecd5e9715f3d043cec13b2ec93ce015d53"
Expand Down Expand Up @@ -2535,6 +2553,20 @@ git-tree-sha1 = "1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d"
uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d"
version = "1.3.0"

[[deps.PythonCall]]
deps = ["CondaPkg", "Dates", "Libdl", "MacroTools", "Markdown", "Pkg", "Serialization", "Tables", "UnsafePointers"]
git-tree-sha1 = "34510e11cabd7964291f32f14d28b367e9960e6e"
uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
version = "0.9.28"

[deps.PythonCall.extensions]
CategoricalArraysExt = "CategoricalArrays"
PyCallExt = "PyCall"

[deps.PythonCall.weakdeps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"

[[deps.QOI]]
deps = ["ColorTypes", "FileIO", "FixedPointNumbers"]
git-tree-sha1 = "8b3fc30bc0390abdce15f8822c889f669baed73d"
Expand Down Expand Up @@ -3316,6 +3348,11 @@ weakdeps = ["LLVM"]
[deps.UnsafeAtomics.extensions]
UnsafeAtomicsLLVM = ["LLVM"]

[[deps.UnsafePointers]]
git-tree-sha1 = "c81331b3b2e60a982be57c046ec91f599ede674a"
uuid = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
version = "1.0.0"

[[deps.VectorInterface]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "cea8abaa6e43f72f97a09cf95b80c9eb53ff75cf"
Expand All @@ -3340,6 +3377,12 @@ git-tree-sha1 = "c1a7aa6219628fcd757dede0ca95e245c5cd9511"
uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6"
version = "1.0.0"

[[deps.XESMF]]
deps = ["CondaPkg", "LinearAlgebra", "PythonCall", "SparseArrays"]
git-tree-sha1 = "f7c53612764f77438c23743d20c926169cb57b45"
uuid = "2e0b0046-e7a1-486f-88de-807ee8ffabe5"
version = "0.1.5"

[[deps.XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"]
git-tree-sha1 = "80d3930c6347cfce7ccf96bd3bafdf079d9c0390"
Expand Down Expand Up @@ -3494,6 +3537,12 @@ git-tree-sha1 = "86addc139bca85fdf9e7741e10977c45785727b7"
uuid = "337d8026-41b4-5cde-a456-74a10e5b31d1"
version = "1.11.3+0"

[[deps.micromamba_jll]]
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"]
git-tree-sha1 = "2ca2ac0b23a8e6b76752453e08428b3b4de28095"
uuid = "f8abcde7-e9b7-5caa-b8af-a437887ae8e4"
version = "1.5.12+0"

[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
Expand All @@ -3510,6 +3559,12 @@ deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "17.4.0+2"

[[deps.pixi_jll]]
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"]
git-tree-sha1 = "f349584316617063160a947a82638f7611a8ef0f"
uuid = "4d7b5844-a134-5dcd-ac86-c8f19cd51bed"
version = "0.41.3+0"

[[deps.x264_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "14cc7083fc6dff3cc44f2bc435ee96d06ed79aa7"
Expand Down
5 changes: 4 additions & 1 deletion experiments/ClimaEarth/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Oceananigans = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
Poppler_jll = "9c32591e-4766-534b-9725-b71a8799265b"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SurfaceFluxes = "49b00bb7-8bd4-4f2b-b78c-51cd0450215f"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
XESMF = "2e0b0046-e7a1-486f-88de-807ee8ffabe5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
ArgParse = "1.1"
CUDA = "5"
ClimaAnalysis = "0.5.10"
ClimaAtmos = "0.27, 0.28, 0.29, 0.30, 0.31"
ClimaCalibrate = "0.1"
Expand All @@ -46,10 +49,10 @@ ClimaParams = "1.0"
ClimaSeaIce = "0.3"
ClimaTimeSteppers = "0.7, 0.8"
ClimaUtilities = "0.1"
CUDA = "5"
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"
Loading