From 41539427dac0458eb1d028472c4220c581c1a870 Mon Sep 17 00:00:00 2001 From: Neeraja Bhamidipati Date: Mon, 10 Aug 2020 10:13:16 -0600 Subject: [PATCH] De-bugged the code to fix diagnostics for normal and shear stresses --- .../lateral/MOM_hor_visc.F90 | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90 index 3523defd0d..318a4f4c90 100644 --- a/src/parameterizations/lateral/MOM_hor_visc.F90 +++ b/src/parameterizations/lateral/MOM_hor_visc.F90 @@ -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]. @@ -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) :: & @@ -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] @@ -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 @@ -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 @@ -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, &