Skip to content

Add a type for the PrescribedAtmosphereExchanger #449

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ function StateExchanger(ocean::Simulation, atmosphere)
return StateExchanger(ocean.model.grid, exchange_atmosphere_state, exchanger)
end

mutable struct PrescribedAtmosphereExchanger{X, Y}
i :: X
j :: Y
end

Adapt.adapt_structure(to, pae::PrescribedAtmosphereExchanger) = (i=pae.i, j=pae.j)

function atmosphere_exchanger(atmosphere::PrescribedAtmosphere, exchange_grid)
atmos_grid = atmosphere.grid
arch = architecture(exchange_grid)
Expand All @@ -114,7 +121,7 @@ function atmosphere_exchanger(atmosphere::PrescribedAtmosphere, exchange_grid)
TX, TY, TZ = topology(exchange_grid)
fi = TX() isa Flat ? nothing : Field{Center, Center, Nothing}(exchange_grid, FT)
fj = TY() isa Flat ? nothing : Field{Center, Center, Nothing}(exchange_grid, FT)
frac_indices = (i=fi, j=fj) # no k needed, only horizontal interpolation
frac_indices = PrescribedAtmosphereExchanger(i, j)

return frac_indices
end
Expand Down
Loading