Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,9 @@ subroutine register_restarts_dyn_split_RK2(HI, GV, US, param_file, CS, restart_C
ALLOC_(CS%v_av(isd:ied,JsdB:JedB,nz)) ; CS%v_av(:,:,:) = 0.0
ALLOC_(CS%h_av(isd:ied,jsd:jed,nz)) ; CS%h_av(:,:,:) = GV%Angstrom_H

allocate(CS%taux_bot(IsdB:IedB,jsd:jed), source = 0.0)
allocate(CS%tauy_bot(isd:ied,JsdB:JedB), source = 0.0)

thickness_units = get_thickness_units(GV)
flux_units = get_flux_units(GV)

Expand Down Expand Up @@ -1310,6 +1313,18 @@ subroutine register_restarts_dyn_split_RK2(HI, GV, US, param_file, CS, restart_C

call register_barotropic_restarts(HI, GV, US, param_file, CS%barotropic_CSp, restart_CS)

call get_param(param_file, mdl, "SPLIT_BOTTOM_STRESS", CS%split_bottom_stress, &
"If true, provide the bottom stress calculated by the "//&
"vertical viscosity to the barotropic solver.", default=.false.,&
do_not_log=.true.)

if (CS%split_bottom_stress) then
vd(1) = var_desc("taux_bot", "kg m-1 s-2", "Zonal bottom stress", 'u', '1')
vd(2) = var_desc("tauy_bot", "kg m-1 s-2", "Meridional bottom stress", 'v', '1')
call register_restart_pair(CS%taux_bot, CS%tauy_bot, vd(1), vd(2), .false., restart_CS, &
conversion=US%RLZ_T2_to_Pa)
endif

end subroutine register_restarts_dyn_split_RK2

!> This subroutine does remapping for the auxiliary restart variables that are used
Expand Down Expand Up @@ -1527,9 +1542,6 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
"continuity() and btstep() calls in the corrector step. Default of this flag "//&
"is set by VISC_REM_BUG", default=visc_rem_bug)

allocate(CS%taux_bot(IsdB:IedB,jsd:jed), source=0.0)
allocate(CS%tauy_bot(isd:ied,JsdB:JedB), source=0.0)

ALLOC_(CS%uhbt(IsdB:IedB,jsd:jed)) ; CS%uhbt(:,:) = 0.0
ALLOC_(CS%vhbt(isd:ied,JsdB:JedB)) ; CS%vhbt(:,:) = 0.0
ALLOC_(CS%visc_rem_u(IsdB:IedB,jsd:jed,nz)) ; CS%visc_rem_u(:,:,:) = 0.0
Expand Down Expand Up @@ -1937,6 +1949,7 @@ subroutine end_dyn_split_RK2(CS)

if (associated(CS%taux_bot)) deallocate(CS%taux_bot)
if (associated(CS%tauy_bot)) deallocate(CS%tauy_bot)

DEALLOC_(CS%uhbt) ; DEALLOC_(CS%vhbt)
DEALLOC_(CS%u_accel_bt) ; DEALLOC_(CS%v_accel_bt)
DEALLOC_(CS%visc_rem_u) ; DEALLOC_(CS%visc_rem_v)
Expand Down
19 changes: 16 additions & 3 deletions src/core/MOM_dynamics_split_RK2b.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@ subroutine register_restarts_dyn_split_RK2b(HI, GV, US, param_file, CS, restart_
character(len=48) :: thickness_units, flux_units

integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
character(len=40) :: mdl = "MOM_dynamics_split_RK2b" ! This module's name.

isd = HI%isd ; ied = HI%ied ; jsd = HI%jsd ; jed = HI%jed ; nz = GV%ke
IsdB = HI%IsdB ; IedB = HI%IedB ; JsdB = HI%JsdB ; JedB = HI%JedB
Expand All @@ -1215,6 +1216,9 @@ subroutine register_restarts_dyn_split_RK2b(HI, GV, US, param_file, CS, restart_
ALLOC_(CS%du_av_inst(IsdB:IedB,jsd:jed)) ; CS%du_av_inst(:,:) = 0.0
ALLOC_(CS%dv_av_inst(isd:ied,JsdB:JedB)) ; CS%dv_av_inst(:,:) = 0.0

allocate(CS%taux_bot(IsdB:IedB,jsd:jed), source = 0.0)
allocate(CS%tauy_bot(isd:ied,JsdB:JedB), source = 0.0)

ALLOC_(CS%eta(isd:ied,jsd:jed)) ; CS%eta(:,:) = 0.0

thickness_units = get_thickness_units(GV)
Expand All @@ -1238,6 +1242,18 @@ subroutine register_restarts_dyn_split_RK2b(HI, GV, US, param_file, CS, restart_

call register_barotropic_restarts(HI, GV, US, param_file, CS%barotropic_CSp, restart_CS)

call get_param(param_file, mdl, "SPLIT_BOTTOM_STRESS", CS%split_bottom_stress, &
"If true, provide the bottom stress calculated by the "//&
"vertical viscosity to the barotropic solver.", default=.false.,&
do_not_log=.true.)

if (CS%split_bottom_stress) then
vd(1) = var_desc("taux_bot", "kg m-1 s-2", "Zonal bottom stress", 'u', '1')
vd(2) = var_desc("tauy_bot", "kg m-1 s-2", "Meridional bottom stress", 'v', '1')
call register_restart_pair(CS%taux_bot, CS%tauy_bot, vd(1), vd(2), .false., restart_CS, &
conversion=US%RLZ_T2_to_Pa)
endif

end subroutine register_restarts_dyn_split_RK2b

!> This subroutine does remapping for the auxiliary restart variables that are used
Expand Down Expand Up @@ -1417,9 +1433,6 @@ subroutine initialize_dyn_split_RK2b(u, v, h, tv, uh, vh, eta, Time, G, GV, US,
"is set by VISC_REM_BUG", default=visc_rem_bug)


allocate(CS%taux_bot(IsdB:IedB,jsd:jed), source=0.0)
allocate(CS%tauy_bot(isd:ied,JsdB:JedB), source=0.0)

ALLOC_(CS%uhbt(IsdB:IedB,jsd:jed)) ; CS%uhbt(:,:) = 0.0
ALLOC_(CS%vhbt(isd:ied,JsdB:JedB)) ; CS%vhbt(:,:) = 0.0
ALLOC_(CS%visc_rem_u(IsdB:IedB,jsd:jed,nz)) ; CS%visc_rem_u(:,:,:) = 0.0
Expand Down
Loading