Skip to content

Commit

Permalink
Merge pull request mom-ocean#1470 from Hallberg-NOAA/OBC_cg_depth_fix
Browse files Browse the repository at this point in the history
(*)Use summed thicknesses in OBC wave speed
  • Loading branch information
marshallward authored Aug 23, 2021
2 parents 7766f3b + 00ea6c7 commit 817217e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3811,8 +3811,7 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
segment%h(I,j,k) = h(i+ishift,j,k)
segment%Htot(I,j) = segment%Htot(I,j) + segment%h(I,j,k)
enddo
segment%Cg(I,j) = sqrt(GV%g_prime(1)*G%bathyT(i+ishift,j))
!### This should be: segment%Cg(I,j) = sqrt(GV%g_prime(1)*segment%Htot(I,j)*GV%H_to_Z)
segment%Cg(I,j) = sqrt(GV%g_prime(1)*segment%Htot(I,j)*GV%H_to_Z)
enddo
else! (segment%direction == OBC_DIRECTION_N .or. segment%direction == OBC_DIRECTION_S)
allocate(normal_trans_bt(segment%HI%isd:segment%HI%ied,segment%HI%JsdB:segment%HI%JedB))
Expand All @@ -3825,8 +3824,7 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
segment%h(i,J,k) = h(i,j+jshift,k)
segment%Htot(i,J) = segment%Htot(i,J) + segment%h(i,J,k)
enddo
segment%Cg(i,J) = sqrt(GV%g_prime(1)*G%bathyT(i,j+jshift))
!### This should be: segment%Cg(i,J) = sqrt(GV%g_prime(1)*segment%Htot(i,J)*GV%H_to_Z)
segment%Cg(i,J) = sqrt(GV%g_prime(1)*segment%Htot(i,J)*GV%H_to_Z)
enddo
endif

Expand Down
12 changes: 4 additions & 8 deletions src/user/Kelvin_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,11 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
km_to_L_scale = 1000.0*US%m_to_L

do j=jsd,jed ; do i=isd,ied
depth_tot(i,j) = G%bathyT(i,j)
depth_tot(i,j) = 0.0
enddo ; enddo
!### Instead this should be:
! do j=jsd,jed ; do i=isd,ied
! depth_tot(i,j) = 0.0
! enddo ; enddo
! do j=jsd,jed ; do i=isd,ied
! depth_tot(i,j) = depth_tot(i,j) + GV%H_to_Z * h(i,j,k)
! enddo ; enddo
do k=1,nz ; do j=jsd,jed ; do i=isd,ied
depth_tot(i,j) = depth_tot(i,j) + GV%H_to_Z * h(i,j,k)
enddo ; enddo ; enddo

if (CS%mode == 0) then
mag_SSH = 1.0*US%m_to_Z
Expand Down

0 comments on commit 817217e

Please sign in to comment.