@@ -561,8 +561,6 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
561
561
real , intent (in ) :: dt ! < Time increment [T ~> s]
562
562
type (VarMix_CS), intent (inout ) :: CS ! < Variable mixing control struct
563
563
type (MEKE_type), intent (in ) :: MEKE ! < MEKE struct
564
- ! type(ocean_OBC_type), pointer :: OBC !< Open
565
- ! boundaries control structure.
566
564
567
565
! Local variables
568
566
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)
576
574
real , dimension (SZI_(G), SZJ_(G)) :: f ! Absolute value of the Coriolis parameter at h point [T-1 ~> s-1]
577
575
real :: N2 ! Positive buoyancy frequency square or zero [L2 Z-2 T-2 ~> s-2]
578
576
real :: dzc ! Spacing between two adjacent layers in stretched vertical coordinate [m]
579
- ! real, dimension(SZK_(GV)) :: zs ! Stretched vertical coordinate [m]
580
577
real , dimension (SZI_(G), SZJ_(G)) :: Le ! Eddy length scale [m]
581
578
integer :: i, j, k, is, ie, js, je, nz
582
579
@@ -596,28 +593,23 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
596
593
if (allocated (MEKE% Le)) then
597
594
do j= js,je ; do i= is,ie
598
595
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 )
601
598
enddo ; enddo
602
599
else
603
600
do j= js,je ; do i= is,ie
604
601
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 )
607
604
enddo ; enddo
608
605
endif
609
606
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))))
615
611
enddo ; enddo ; enddo
616
612
617
- if (CS% debug) then
618
- call hchksum(CS% sqg_struct, ' sqg_struct' , G% HI)
619
- endif
620
-
621
613
622
614
if (query_averaging_enabled(CS% diag)) then
623
615
if (CS% id_sqg_struct > 0 ) call post_data(CS% id_sqg_struct, CS% sqg_struct, CS% diag)
0 commit comments