Skip to content

Commit

Permalink
Solved the dimension issue for sqg_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendazhang33 committed Oct 11, 2024
1 parent 8309221 commit 3983a98
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,18 @@ subroutine calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1)), 1.0e-8*US%T_to_s)
enddo ; enddo
endif
if (CS%debug) then
call hchksum(Le, 'SQG length scale', G%HI, unscale=US%L_to_m)
call hchksum(f, 'Coriolis at h point', G%HI, unscale=US%s_to_T)
call uvchksum( 'MEKE LmixScale', dzu, dzv, G%HI, unscale=US%Z_to_m, scalar_pair=.true.)
endif
do k=2,nz ; do j=js,je ; do i=is,ie
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)
dzc = 0.25*(dzu(I-1,j,k) + dzu(I,j,k) + dzv(i,J-1,k) + dzv(i,J,k)) * &
N2**0.5/f(i,j)*US%Z_to_L
N2**0.5/f(i,j)
! dzs = -N2**0.5/f(i,j)*dzc
CS%sqg_struct(i,j,k) = CS%sqg_struct(i,j,k-1)*exp(-CS%sqg_expo*dzc/Le(i,j))
CS%sqg_struct(i,j,k) = CS%sqg_struct(i,j,k-1)*exp(-CS%sqg_expo*(dzc/Le(i,j)))
enddo ; enddo ; enddo

if (CS%debug) then
call hchksum(CS%sqg_struct, 'sqg_struct', G%HI)
endif


if (query_averaging_enabled(CS%diag)) then
if (CS%id_sqg_struct > 0) call post_data(CS%id_sqg_struct, CS%sqg_struct, CS%diag)
Expand Down

0 comments on commit 3983a98

Please sign in to comment.