Skip to content

Commit 2b195b7

Browse files
committed
Replaced **0.5 to sqrt() in calc_sqg_struct
1 parent be40102 commit 2b195b7

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
561561
real, intent(in) :: dt !< Time increment [T ~> s]
562562
type(VarMix_CS), intent(inout) :: CS !< Variable mixing control struct
563563
type(MEKE_type), intent(in) :: MEKE !< MEKE struct
564-
! type(ocean_OBC_type), pointer :: OBC !< Open
565-
! boundaries control structure.
566564

567565
! Local variables
568566
real, dimension(SZI_(G), SZJ_(G),SZK_(GV)+1) :: &
@@ -576,7 +574,6 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
576574
real, dimension(SZI_(G), SZJ_(G)) :: f ! Absolute value of the Coriolis parameter at h point [T-1 ~> s-1]
577575
real :: N2 ! Positive buoyancy frequency square or zero [L2 Z-2 T-2 ~> s-2]
578576
real :: dzc ! Spacing between two adjacent layers in stretched vertical coordinate [m]
579-
! real, dimension(SZK_(GV)) :: zs ! Stretched vertical coordinate [m]
580577
real, dimension(SZI_(G), SZJ_(G)) :: Le ! Eddy length scale [m]
581578
integer :: i, j, k, is, ie, js, je, nz
582579

@@ -596,28 +593,23 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
596593
if (allocated(MEKE%Le)) then
597594
do j=js,je ; do i=is,ie
598595
Le(i,j) = MEKE%Le(i,j)
599-
f(i,j) = max(0.25*abs(G%CoriolisBu(I,J) + G%CoriolisBu(I-1,J-1) + &
600-
G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1)), 1.0e-8/US%T_to_s)
596+
f(i,j) = max(0.25 * abs((G%CoriolisBu(I,J) + G%CoriolisBu(I-1,J-1)) + &
597+
(G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1))), 1.0e-8 * US%s_to_T)
601598
enddo ; enddo
602599
else
603600
do j=js,je ; do i=is,ie
604601
Le(i,j) = sqrt(G%areaT(i,j))
605-
f(i,j) = max(0.25*abs(G%CoriolisBu(I,J) + G%CoriolisBu(I-1,J-1) + &
606-
G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1)), 1.0e-8*US%T_to_s)
602+
f(i,j) = max(0.25 * abs((G%CoriolisBu(I,J) + G%CoriolisBu(I-1,J-1)) + &
603+
(G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1))), 1.0e-8 * US%s_to_T)
607604
enddo ; enddo
608605
endif
609606
do k=2,nz ; do j=js,je ; do i=is,ie
610-
N2 = max(0.25*(N2_u(I-1,j,k) + N2_u(I,j,k) + N2_v(i,J-1,k) + N2_v(i,J,k)),0.0)
611-
dzc = 0.25*(dzu(I-1,j,k) + dzu(I,j,k) + dzv(i,J-1,k) + dzv(i,J,k)) * &
612-
N2**0.5/f(i,j)
613-
! dzs = -N2**0.5/f(i,j)*dzc
614-
CS%sqg_struct(i,j,k) = CS%sqg_struct(i,j,k-1)*exp(-CS%sqg_expo*(dzc/Le(i,j)))
607+
N2 = max(0.25 * ((N2_u(I-1,j,k) + N2_u(I,j,k)) + (N2_v(i,J-1,k) + N2_v(i,J,k))), 0.0)
608+
dzc = 0.25 * ((dzu(I-1,j,k) + dzu(I,j,k)) + (dzv(i,J-1,k) + dzv(i,J,k)))
609+
CS%sqg_struct(i,j,k) = CS%sqg_struct(i,j,k-1) * &
610+
exp(-CS%sqg_expo * (dzc * sqrt(N2)/(f(i,j) * Le(i,j))))
615611
enddo ; enddo ; enddo
616612

617-
if (CS%debug) then
618-
call hchksum(CS%sqg_struct, 'sqg_struct', G%HI)
619-
endif
620-
621613

622614
if (query_averaging_enabled(CS%diag)) then
623615
if (CS%id_sqg_struct > 0) call post_data(CS%id_sqg_struct, CS%sqg_struct, CS%diag)

0 commit comments

Comments
 (0)