@@ -294,6 +294,8 @@ module MOM
294294 integer :: ntrunc ! < number u,v truncations since last call to write_energy
295295
296296 integer :: cont_stencil ! < The stencil for thickness from the continuity solver.
297+ integer :: dyn_h_stencil ! < The stencil for thickness for the dynamics based on
298+ ! ! the continuity solver and Coriolis schemes.
297299 ! These elements are used to control the dynamics updates.
298300 logical :: do_dynamics ! < If false, does not call step_MOM_dyn_*. This is an
299301 ! ! undocumented run-time flag that is fragile.
@@ -1221,7 +1223,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
12211223 CS% MEKE, CS% VarMix, CS% CDp, CS% thickness_diffuse_CSp, &
12221224 CS% stoch_CS)
12231225 call cpu_clock_end(id_clock_thick_diff)
1224- call pass_var(h, G% Domain, clock= id_clock_pass, halo= max ( 2 , CS% cont_stencil) )
1226+ call pass_var(h, G% Domain, clock= id_clock_pass, halo= CS% dyn_h_stencil )
12251227 if (showCallTree) call callTree_waypoint(" finished thickness_diffuse_first (step_MOM)" )
12261228 endif
12271229
@@ -1232,7 +1234,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
12321234 call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt_tr_adv, G, GV, US, &
12331235 CS% CDp, CS% interface_filter_CSp)
12341236 call cpu_clock_end(id_clock_int_filter)
1235- call pass_var(h, G% Domain, clock= id_clock_pass, halo= max ( 2 , CS% cont_stencil) )
1237+ call pass_var(h, G% Domain, clock= id_clock_pass, halo= CS% dyn_h_stencil )
12361238 if (showCallTree) call callTree_waypoint(" finished interface_filter_first (step_MOM)" )
12371239 endif
12381240
@@ -1345,7 +1347,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
13451347 do j= js,je ; do I= isq,ieq
13461348 u(I,j,:) = u(I,j,:) + Waves% ddt_us_x(I,j,:)* dt
13471349 enddo ; enddo
1348- call pass_vector(u,v, G% Domain)
1350+ call pass_vector(u, v, G% Domain)
13491351 endif
13501352 ! Added an additional output to track Stokes drift time tendency.
13511353 ! It is mostly for debugging, and perhaps doesn't need to hang
@@ -1375,7 +1377,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
13751377 CS% MEKE, CS% VarMix, CS% CDp, CS% thickness_diffuse_CSp, CS% stoch_CS)
13761378
13771379 call cpu_clock_end(id_clock_thick_diff)
1378- call pass_var(h, G% Domain, clock= id_clock_pass, halo= max ( 2 , CS% cont_stencil) )
1380+ call pass_var(h, G% Domain, clock= id_clock_pass, halo= CS% dyn_h_stencil )
13791381 if (CS% debug) call hchksum(h," Post-thickness_diffuse h" , G% HI, haloshift= 1 , unscale= GV% H_to_MKS)
13801382 if (showCallTree) call callTree_waypoint(" finished thickness_diffuse (step_MOM)" )
13811383 endif
@@ -1392,7 +1394,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
13921394 CS% CDp, CS% interface_filter_CSp)
13931395 endif
13941396 call cpu_clock_end(id_clock_int_filter)
1395- call pass_var(h, G% Domain, clock= id_clock_pass, halo= max ( 2 , CS% cont_stencil) )
1397+ call pass_var(h, G% Domain, clock= id_clock_pass, halo= CS% dyn_h_stencil )
13961398 if (showCallTree) call callTree_waypoint(" finished interface_filter (step_MOM)" )
13971399 endif
13981400 endif
@@ -1408,7 +1410,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_tr_adv, &
14081410 call mixedlayer_restrat(h, CS% uhtr, CS% vhtr, CS% tv, forces, dt, CS% visc% MLD, CS% visc% h_ML, &
14091411 CS% visc% sfc_buoy_flx, CS% VarMix, G, GV, US, CS% mixedlayer_restrat_CSp)
14101412 call cpu_clock_end(id_clock_ml_restrat)
1411- call pass_var(h, G% Domain, clock= id_clock_pass, halo= max ( 2 , CS% cont_stencil) )
1413+ call pass_var(h, G% Domain, clock= id_clock_pass, halo= CS% dyn_h_stencil )
14121414 if (CS% debug) then
14131415 call hchksum(h," Post-mixedlayer_restrat h" , G% HI, haloshift= 1 , unscale= GV% H_to_MKS)
14141416 call uvchksum(" Post-mixedlayer_restrat [uv]htr" , &
@@ -3506,13 +3508,15 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
35063508 G, GV, US, param_file, diag, CS% dyn_split_RK2b_CSp, CS% HA_CSp, restart_CSp, &
35073509 CS% dt, CS% ADp, CS% CDp, MOM_internal_state, CS% VarMix, CS% MEKE, &
35083510 CS% thickness_diffuse_CSp, CS% OBC, CS% update_OBC_CSp, CS% ALE_CSp, CS% set_visc_CSp, &
3509- CS% visc, dirs, CS% ntrunc, CS% pbv, calc_dtbt= calc_dtbt, cont_stencil= CS% cont_stencil)
3511+ CS% visc, dirs, CS% ntrunc, CS% pbv, calc_dtbt= calc_dtbt, &
3512+ cont_stencil= CS% cont_stencil, dyn_h_stencil= CS% dyn_h_stencil)
35103513 else
35113514 call initialize_dyn_split_RK2(CS% u, CS% v, CS% h, CS% tv, CS% uh, CS% vh, eta, Time, &
35123515 G, GV, US, param_file, diag, CS% dyn_split_RK2_CSp, CS% HA_CSp, restart_CSp, &
35133516 CS% dt, CS% ADp, CS% CDp, MOM_internal_state, CS% VarMix, CS% MEKE, &
35143517 CS% thickness_diffuse_CSp, CS% OBC, CS% update_OBC_CSp, CS% ALE_CSp, CS% set_visc_CSp, &
3515- CS% visc, dirs, CS% ntrunc, CS% pbv, calc_dtbt= calc_dtbt, cont_stencil= CS% cont_stencil)
3518+ CS% visc, dirs, CS% ntrunc, CS% pbv, calc_dtbt= calc_dtbt, &
3519+ cont_stencil= CS% cont_stencil, dyn_h_stencil= CS% dyn_h_stencil)
35163520 endif
35173521 if (CS% dtbt_reset_period > 0.0 ) then
35183522 CS% dtbt_reset_interval = real_to_time(US% T_to_s* CS% dtbt_reset_period)
@@ -3531,14 +3535,15 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
35313535 US, param_file, diag, CS% dyn_unsplit_RK2_CSp, &
35323536 CS% ADp, CS% CDp, MOM_internal_state, CS% OBC, &
35333537 CS% update_OBC_CSp, CS% ALE_CSp, CS% set_visc_CSp, CS% visc, dirs, &
3534- CS% ntrunc, cont_stencil= CS% cont_stencil)
3538+ CS% ntrunc, cont_stencil= CS% cont_stencil, dyn_h_stencil = CS % dyn_h_stencil )
35353539 else
35363540 call initialize_dyn_unsplit(CS% u, CS% v, CS% h, CS% tv, Time, G, GV, &
35373541 US, param_file, diag, CS% dyn_unsplit_CSp, &
35383542 CS% ADp, CS% CDp, MOM_internal_state, CS% OBC, &
35393543 CS% update_OBC_CSp, CS% ALE_CSp, CS% set_visc_CSp, CS% visc, dirs, &
3540- CS% ntrunc, cont_stencil= CS% cont_stencil)
3544+ CS% ntrunc, cont_stencil= CS% cont_stencil, dyn_h_stencil = CS % dyn_h_stencil )
35413545 endif
3546+ CS% dyn_h_stencil = max (2 , CS% dyn_h_stencil)
35423547
35433548 ! Set OBC segment data update period
35443549 if (associated (CS% OBC) .and. CS% dt_obc_seg_period > 0.0 ) then
0 commit comments