diff --git a/src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl b/src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl index ab77fc816..8e5a3aa76 100644 --- a/src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl +++ b/src/OceanSeaIceModels/InterfaceComputations/component_interfaces.jl @@ -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) @@ -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