@@ -201,14 +201,6 @@ def bathymetry(x_t_2d, y_t_2d, lx, ly):
201
201
bath = 1.0
202
202
return bath * create_full (T_shape , 1.0 , dtype )
203
203
204
- # inital elevation
205
- u0 , v0 , e0 = exact_solution (
206
- 0 , x_t_2d , y_t_2d , x_u_2d , y_u_2d , x_v_2d , y_v_2d
207
- )
208
- e [:, :] = e0
209
- u [:, :] = u0
210
- v [:, :] = v0
211
-
212
204
# set bathymetry
213
205
h [:, :] = bathymetry (x_t_2d , y_t_2d , lx , ly )
214
206
# steady state potential energy
@@ -325,6 +317,18 @@ def step(u, v, e, u1, v1, e1, u2, v2, e2):
325
317
v [:, 1 :- 1 ] = v [:, 1 :- 1 ] / 3.0 + 2.0 / 3.0 * (v2 [:, 1 :- 1 ] + dt * dvdt )
326
318
e [:, :] = e [:, :] / 3.0 + 2.0 / 3.0 * (e2 [:, :] + dt * dedt )
327
319
320
+ # warm up jit cache
321
+ step (u , v , e , u1 , v1 , e1 , u2 , v2 , e2 )
322
+ sync ()
323
+
324
+ # initial solution
325
+ u0 , v0 , e0 = exact_solution (
326
+ 0 , x_t_2d , y_t_2d , x_u_2d , y_u_2d , x_v_2d , y_v_2d
327
+ )
328
+ e [:, :] = e0
329
+ u [:, :] = u0
330
+ v [:, :] = v0
331
+
328
332
t = 0
329
333
i_export = 0
330
334
next_t_export = 0
0 commit comments