Skip to content

Commit

Permalink
De-bugged the code to fix diagnostics for normal and shear stresses
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajabhamidipati committed Aug 10, 2020
1 parent 1978854 commit 4153942
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(out) :: diffu !< Zonal acceleration due to convergence of
!! along-coordinate stress tensor [L T-2 ~> m s-2]
real, dimension(SZIB_(G),SZJB_(G),SZK_(G)) :: &
intent(out) :: NoSt !< Normal stress [T-1 ~> s-1].

real, dimension(SZIB_(G),SZJB_(G),SZK_(G)) :: &
intent(out) :: ShSt !< Shear stress [T-1 ~> s-1].

real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(out) :: diffv !< Meridional acceleration due to convergence
!! of along-coordinate stress tensor [L T-2 ~> m s-2].
Expand Down Expand Up @@ -298,8 +292,8 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
Kh_q, & ! Laplacian viscosity at corner points [L2 T-1 ~> m2 s-1]
vort_xy_q, & ! vertical vorticity at corner points [T-1 ~> s-1]
GME_coeff_q, & !< GME coeff. at q-points [L2 T-1 ~> m2 s-1]
max_diss_rate_q ! maximum possible energy dissipated by lateral friction [L2 T-3 ~> m2 s-3]

max_diss_rate_q, & ! maximum possible energy dissipated by lateral friction [L2 T-3 ~> m2 s-3]
ShSt !< A diagnostic array of shear stress [T-1 ~> s-1].
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)+1) :: &
KH_u_GME !< interface height diffusivities in u-columns [L2 T-1 ~> m2 s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)+1) :: &
Expand All @@ -310,7 +304,8 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
max_diss_rate_h, & ! maximum possible energy dissipated by lateral friction [L2 T-3 ~> m2 s-3]
FrictWork, & ! work done by MKE dissipation mechanisms [R L2 T-3 ~> W m-2]
FrictWork_GME, & ! work done by GME [R L2 T-3 ~> W m-2]
div_xx_h ! horizontal divergence [T-1 ~> s-1]
div_xx_h, & ! horizontal divergence [T-1 ~> s-1]
NoSt !< A diagnostic array of normal stress [T-1 ~> s-1].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: &
GME_coeff_h !< GME coeff. at h-points [L2 T-1 ~> m2 s-1]
real :: Ah ! biharmonic viscosity [L4 T-1 ~> m4 s-1]
Expand Down Expand Up @@ -508,7 +503,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
dvdy(i,j) = CS%DX_dyT(i,j)*(G%IdxCv(i,J) * v(i,J,k) - &
G%IdxCv(i,J-1) * v(i,J-1,k))
sh_xx(i,j) = dudx(i,j) - dvdy(i,j)
if (CS%id_normstress > 0) NoSt(i,j,k) = sh_xx
if (CS%id_normstress > 0) NoSt(i,j,k) = sh_xx(i,j)
enddo ; enddo

! Components for the shearing strain
Expand Down Expand Up @@ -656,12 +651,12 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
if (CS%no_slip) then
do J=js-2,Jeq+1 ; do I=is-2,Ieq+1
sh_xy(I,J) = (2.0-G%mask2dBu(I,J)) * ( dvdx(I,J) + dudy(I,J) )
if (CS%id_shearstress > 0) ShSt(I,J,k) = sh_xy
if (CS%id_shearstress > 0) ShSt(I,J,k) = sh_xy(I,J)
enddo ; enddo
else
do J=js-2,Jeq+1 ; do I=is-2,Ieq+1
sh_xy(I,J) = G%mask2dBu(I,J) * ( dvdx(I,J) + dudy(I,J) )
if (CS%id_shearstress > 0) ShSt(I,J,k) = sh_xy
if (CS%id_shearstress > 0) ShSt(I,J,k) = sh_xy(I,J)
enddo ; enddo
endif

Expand Down Expand Up @@ -2033,7 +2028,7 @@ subroutine hor_visc_init(Time, G, US, param_file, diag, CS, MEKE)
endif

! Register fields for output from this module.
CS%id_normstress = register_diag_field('ocean_model', 'NoSt', diag%axesBL, Time, &
CS%id_normstress = register_diag_field('ocean_model', 'NoSt', diag%axesTL, Time, &
'Normal Stress', 's-1', conversion=US%s_to_T)

CS%id_shearstress = register_diag_field('ocean_model', 'ShSt', diag%axesBL, Time, &
Expand Down

0 comments on commit 4153942

Please sign in to comment.