Skip to content

Commit

Permalink
Tweaks in response to Hallberg's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Apr 7, 2022
1 parent 7a2af6c commit 4b218c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 11 additions & 2 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ subroutine ALE_regrid_accelerated(CS, G, GV, h, tv, n, u, v, OBC, Reg, dt, dzReg
! we have to keep track of the total dzInterface if for some reason
! we're using the old remapping algorithm for u/v
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: dzInterface, dzIntTotal
real :: h_neglect, h_neglect_edge

nz = GV%ke

Expand All @@ -744,6 +745,14 @@ subroutine ALE_regrid_accelerated(CS, G, GV, h, tv, n, u, v, OBC, Reg, dt, dzReg
if (present(dt)) &
call ALE_update_regrid_weights(dt, CS)

if (.not. CS%answers_2018) then
h_neglect = GV%H_subroundoff ; h_neglect_edge = GV%H_subroundoff
elseif (GV%Boussinesq) then
h_neglect = GV%m_to_H * 1.0e-30 ; h_neglect_edge = GV%m_to_H * 1.0e-10
else
h_neglect = GV%kg_m2_to_H * 1.0e-30 ; h_neglect_edge = GV%kg_m2_to_H * 1.0e-10
endif

do k = 1, n
call do_group_pass(pass_T_S_h, G%domain)

Expand All @@ -754,9 +763,9 @@ subroutine ALE_regrid_accelerated(CS, G, GV, h, tv, n, u, v, OBC, Reg, dt, dzReg
! remap from original grid onto new grid
do j = G%jsc-1,G%jec+1 ; do i = G%isc-1,G%iec+1
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%S(i,j,:), nz, h(i,j,:), tv_local%S(i,j,:), &
GV%H_subroundoff, GV%H_subroundoff)
h_neglect, h_neglect_edge)
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%T(i,j,:), nz, h(i,j,:), tv_local%T(i,j,:), &
GV%H_subroundoff, GV%H_subroundoff)
h_neglect, h_neglect_edge)
enddo ; enddo

! starting grid for next iteration
Expand Down
8 changes: 4 additions & 4 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1245,11 +1245,11 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
if (Htot_avg*CS%dy_Cu(I,j) <= 0.0) then
CS%IDatu(I,j) = 0.0
elseif (integral_BT_cont) then
CS%IDatu(I,j) = CS%dy_Cu(I,j) / (max(find_duhbt_du(ubt(I,j)*dt, BTCL_u(I,j)), &
CS%dy_Cu(I,j)*Htot_avg) ) * GV%Z_to_H
CS%IDatu(I,j) = GV%Z_to_H * CS%dy_Cu(I,j) / (max(find_duhbt_du(ubt(I,j)*dt, BTCL_u(I,j)), &
CS%dy_Cu(I,j)*Htot_avg) )
elseif (use_BT_cont) then ! Reconsider the max and whether there should be some scaling.
CS%IDatu(I,j) = CS%dy_Cu(I,j) / (max(find_duhbt_du(ubt(I,j), BTCL_u(I,j)), &
CS%dy_Cu(I,j)*Htot_avg) ) * GV%Z_to_H
CS%IDatu(I,j) = GV%Z_to_H * CS%dy_Cu(I,j) / (max(find_duhbt_du(ubt(I,j), BTCL_u(I,j)), &
CS%dy_Cu(I,j)*Htot_avg) )
else
CS%IDatu(I,j) = GV%Z_to_H / Htot_avg
endif
Expand Down

0 comments on commit 4b218c0

Please sign in to comment.