Skip to content
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