@@ -302,6 +302,8 @@ module MOM
302
302
! ! after any calls to thickness_diffuse.
303
303
logical :: thickness_diffuse ! < If true, diffuse interface height w/ a diffusivity KHTH.
304
304
logical :: thickness_diffuse_first ! < If true, diffuse thickness before dynamics.
305
+ logical :: interface_filter_dt_bug ! < If true, uses the wrong time interval in
306
+ ! ! calls to interface_filter and thickness_diffuse.
305
307
logical :: mixedlayer_restrat ! < If true, use submesoscale mixed layer restratifying scheme.
306
308
logical :: useMEKE ! < If true, call the MEKE parameterization.
307
309
logical :: use_stochastic_EOS ! < If true, use the stochastic EOS parameterizations.
@@ -550,7 +552,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
550
552
real :: dtdia ! time step for diabatic processes [T ~> s]
551
553
real :: dt_tr_adv ! time step for tracer advection [T ~> s]
552
554
real :: dt_therm ! a limited and quantized version of CS%dt_therm [T ~> s]
553
- real :: dt_therm_here ! a further limited value of dt_therm [T ~> s]
555
+ real :: dt_tradv_here ! a further limited value of dt_tr_adv [T ~> s]
554
556
555
557
real :: wt_end, wt_beg ! Fractional weights of the future pressure at the end
556
558
! and beginning of the current time step [nondim]
@@ -914,9 +916,15 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
914
916
enddo ; enddo ; enddo
915
917
endif
916
918
917
- dt_therm_here = dt_therm
918
- if (do_thermo .and. do_dyn .and. .not. thermo_does_span_coupling) &
919
- dt_therm_here = dt* min (ntstep, n_max- n+1 )
919
+ if (CS% interface_filter_dt_bug) then
920
+ dt_tradv_here = dt_therm
921
+ if (do_thermo .and. do_dyn .and. .not. thermo_does_span_coupling) &
922
+ dt_tradv_here = dt* min (ntstep, n_max- n+1 )
923
+ else
924
+ dt_tradv_here = dt_tr_adv
925
+ if (do_thermo .and. do_dyn .and. .not. tradv_does_span_coupling) &
926
+ dt_tradv_here = dt* min (ntstep, n_max- n+1 )
927
+ endif
920
928
921
929
! Indicate whether the bottom boundary layer properties need to be
922
930
! recalculated, and if so for how long an interval they are valid.
@@ -943,7 +951,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
943
951
if (associated (CS% HA_CSp)) call HA_accum_FtF(Time_Local, CS% HA_CSp)
944
952
945
953
call step_MOM_dynamics(forces, CS% p_surf_begin, CS% p_surf_end, dt, &
946
- dt_therm_here , bbl_time_int, CS, &
954
+ dt_tradv_here , bbl_time_int, CS, &
947
955
Time_local, Waves= Waves)
948
956
949
957
! ===========================================================================
@@ -1149,7 +1157,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
1149
1157
end subroutine step_MOM
1150
1158
1151
1159
! > Time step the ocean dynamics, including the momentum and continuity equations
1152
- subroutine step_MOM_dynamics (forces , p_surf_begin , p_surf_end , dt , dt_thermo , &
1160
+ subroutine step_MOM_dynamics (forces , p_surf_begin , p_surf_end , dt , dt_tr_adv , &
1153
1161
bbl_time_int , CS , Time_local , Waves )
1154
1162
type (mech_forcing), intent (in ) :: forces ! < A structure with the driving mechanical forces
1155
1163
real , dimension (:,:), pointer :: p_surf_begin ! < A pointer (perhaps NULL) to the surface
@@ -1159,7 +1167,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
1159
1167
! ! pressure at the end of this dynamic step,
1160
1168
! ! intent in [R L2 T-2 ~> Pa].
1161
1169
real , intent (in ) :: dt ! < time interval covered by this call [T ~> s].
1162
- real , intent (in ) :: dt_thermo ! < time interval covered by any updates that may
1170
+ real , intent (in ) :: dt_tr_adv ! < time interval covered by any updates that may
1163
1171
! ! span multiple dynamics steps [T ~> s].
1164
1172
real , intent (in ) :: bbl_time_int ! < time interval over which updates to the
1165
1173
! ! bottom boundary layer properties will apply [T ~> s],
@@ -1211,12 +1219,12 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
1211
1219
if ((CS% t_dyn_rel_adv == 0.0 ) .and. CS% thickness_diffuse_first .and. &
1212
1220
(CS% thickness_diffuse .or. CS% interface_filter)) then
1213
1221
1214
- call enable_averages(dt_thermo , Time_local+ real_to_time(US% T_to_s* (dt_thermo - dt)), CS% diag)
1222
+ call enable_averages(dt_tr_adv , Time_local+ real_to_time(US% T_to_s* (dt_tr_adv - dt)), CS% diag)
1215
1223
if (CS% thickness_diffuse) then
1216
1224
call cpu_clock_begin(id_clock_thick_diff)
1217
1225
if (CS% VarMix% use_variable_mixing) &
1218
1226
call calc_slope_functions(h, CS% tv, dt, G, GV, US, CS% VarMix, OBC= CS% OBC)
1219
- call thickness_diffuse(h, CS% uhtr, CS% vhtr, CS% tv, dt_thermo , G, GV, US, &
1227
+ call thickness_diffuse(h, CS% uhtr, CS% vhtr, CS% tv, dt_tr_adv , G, GV, US, &
1220
1228
CS% MEKE, CS% VarMix, CS% CDp, CS% thickness_diffuse_CSp)
1221
1229
call cpu_clock_end(id_clock_thick_diff)
1222
1230
call pass_var(h, G% Domain, clock= id_clock_pass, halo= max (2 ,CS% cont_stencil))
@@ -1227,7 +1235,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
1227
1235
if (allocated (CS% tv% SpV_avg)) call pass_var(CS% tv% SpV_avg, G% Domain, clock= id_clock_pass)
1228
1236
CS% tv% valid_SpV_halo = min (G% Domain% nihalo, G% Domain% njhalo)
1229
1237
call cpu_clock_begin(id_clock_int_filter)
1230
- call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt_thermo , G, GV, US, &
1238
+ call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt_tr_adv , G, GV, US, &
1231
1239
CS% CDp, CS% interface_filter_CSp)
1232
1240
call cpu_clock_end(id_clock_int_filter)
1233
1241
call pass_var(h, G% Domain, clock= id_clock_pass, halo= max (2 ,CS% cont_stencil))
@@ -1379,8 +1387,13 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
1379
1387
if (allocated (CS% tv% SpV_avg)) call pass_var(CS% tv% SpV_avg, G% Domain, clock= id_clock_pass)
1380
1388
CS% tv% valid_SpV_halo = min (G% Domain% nihalo, G% Domain% njhalo)
1381
1389
call cpu_clock_begin(id_clock_int_filter)
1382
- call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt_thermo, G, GV, US, &
1383
- CS% CDp, CS% interface_filter_CSp)
1390
+ if (CS% interface_filter_dt_bug) then
1391
+ call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt_tr_adv, G, GV, US, &
1392
+ CS% CDp, CS% interface_filter_CSp)
1393
+ else
1394
+ call interface_filter(h, CS% uhtr, CS% vhtr, CS% tv, dt, G, GV, US, &
1395
+ CS% CDp, CS% interface_filter_CSp)
1396
+ endif
1384
1397
call cpu_clock_end(id_clock_int_filter)
1385
1398
call pass_var(h, G% Domain, clock= id_clock_pass, halo= max (2 ,CS% cont_stencil))
1386
1399
if (showCallTree) call callTree_waypoint(" finished interface_filter (step_MOM)" )
@@ -2434,16 +2447,6 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
2434
2447
" BULKMIXEDLAYER can not be used with USE_REGRIDDING. " // &
2435
2448
" The default is influenced by ENABLE_THERMODYNAMICS." , &
2436
2449
default= use_temperature .and. .not. CS% use_ALE_algorithm)
2437
- call get_param(param_file, " MOM" , " THICKNESSDIFFUSE" , CS% thickness_diffuse, &
2438
- " If true, isopycnal surfaces are diffused with a Laplacian " // &
2439
- " coefficient of KHTH." , default= .false. )
2440
- call get_param(param_file, " MOM" , " APPLY_INTERFACE_FILTER" , CS% interface_filter, &
2441
- " If true, model interface heights are subjected to a grid-scale " // &
2442
- " dependent spatial smoothing, often with biharmonic filter." , default= .false. )
2443
- call get_param(param_file, " MOM" , " THICKNESSDIFFUSE_FIRST" , CS% thickness_diffuse_first, &
2444
- " If true, do thickness diffusion or interface height smoothing before dynamics. " // &
2445
- " This is only used if THICKNESSDIFFUSE or APPLY_INTERFACE_FILTER is true." , &
2446
- default= .false. , do_not_log= .not. (CS% thickness_diffuse.or. CS% interface_filter))
2447
2450
call get_param(param_file, " MOM" , " USE_POROUS_BARRIER" , CS% use_porbar, &
2448
2451
" If true, use porous barrier to constrain the widths " // &
2449
2452
" and face areas at the edges of the grid cells. " , &
@@ -2499,6 +2502,26 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
2499
2502
if ( CS% diabatic_first .and. (CS% dt_tr_adv /= CS% dt_therm) ) then
2500
2503
call MOM_error(FATAL," MOM: If using DIABATIC_FIRST, DT_TRACER_ADVECT must equal DT_THERM." )
2501
2504
endif
2505
+ call get_param(param_file, " MOM" , " THICKNESSDIFFUSE" , CS% thickness_diffuse, &
2506
+ " If true, isopycnal surfaces are diffused with a Laplacian " // &
2507
+ " coefficient of KHTH." , default= .false. )
2508
+ call get_param(param_file, " MOM" , " APPLY_INTERFACE_FILTER" , CS% interface_filter, &
2509
+ " If true, model interface heights are subjected to a grid-scale " // &
2510
+ " dependent spatial smoothing, often with biharmonic filter." , default= .false. )
2511
+ call get_param(param_file, " MOM" , " THICKNESSDIFFUSE_FIRST" , CS% thickness_diffuse_first, &
2512
+ " If true, do thickness diffusion or interface height smoothing before dynamics. " // &
2513
+ " This is only used if THICKNESSDIFFUSE or APPLY_INTERFACE_FILTER is true." , &
2514
+ default= .false. , do_not_log= .not. (CS% thickness_diffuse.or. CS% interface_filter))
2515
+ CS% interface_filter_dt_bug = .false.
2516
+ if ((.not. CS% thickness_diffuse_first .and. CS% interface_filter) .or. &
2517
+ (CS% thickness_diffuse_first .and. (CS% thickness_diffuse .or. CS% interface_filter) &
2518
+ .and. (CS% dt_tr_adv /= CS% dt_therm))) then
2519
+ call get_param(param_file, " MOM" , " INTERFACE_FILTER_DT_BUG" , CS% interface_filter_dt_bug, &
2520
+ " If true, uses the wrong time interval in calls to interface_filter " // &
2521
+ " and thickness_diffuse. Has no effect when THICKNESSDIFFUSE_FIRST is " // &
2522
+ " true and DT_TRACER_ADVECT = DT_THERMO or when THICKNESSDIFFUSE_FIRST " // &
2523
+ " is false and APPLY_INTERFACE_FILTER is false. " , default= .false. )
2524
+ endif
2502
2525
2503
2526
if (bulkmixedlayer) then
2504
2527
CS% Hmix = - 1.0 ; CS% Hmix_UV = - 1.0
0 commit comments