Skip to content

Commit 58d785e

Browse files
authored
Compute time interpolator inside time interpolation kernel (#420)
1 parent a928e24 commit 58d785e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/OceanSeaIceModels/InterfaceComputations/interpolate_atmospheric_state.jl

+7-4
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ function interpolate_atmosphere_state!(interfaces, atmosphere::PrescribedAtmosph
6363

6464
# Assumption, should be generalized
6565
ua = atmosphere.velocities.u
66-
time_interpolator = TimeInterpolator(ua, clock.time)
6766

6867
launch!(arch, grid, kernel_parameters,
6968
_interpolate_primary_atmospheric_state!,
7069
atmosphere_data,
7170
space_fractional_indices,
72-
time_interpolator,
71+
clock.time,
72+
ua.times,
73+
ua.time_indexing,
7374
exchange_grid,
7475
atmosphere_velocities,
7576
atmosphere_tracers,
@@ -119,7 +120,9 @@ end
119120

120121
@kernel function _interpolate_primary_atmospheric_state!(surface_atmos_state,
121122
space_fractional_indices,
122-
time_interpolator,
123+
time,
124+
atmos_times,
125+
time_indexing,
123126
exchange_grid,
124127
atmos_velocities,
125128
atmos_tracers,
@@ -137,7 +140,7 @@ end
137140
fj = get_fractional_index(i, j, jj)
138141

139142
x_itp = FractionalIndices(fi, fj, nothing)
140-
t_itp = time_interpolator
143+
t_itp = TimeInterpolator(time_indexing, atmos_times, time)
141144
atmos_args = (x_itp, t_itp, atmos_backend, atmos_time_indexing)
142145

143146
uₐ = interp_atmos_time_series(atmos_velocities.u, atmos_args...)

0 commit comments

Comments
 (0)