@@ -180,7 +180,8 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS)
180180 call wave_speed(h, tv, G, GV, US, CS% cg1, CS% wave_speed_CSp, modal_structure= CS% ebt_struct)
181181 else
182182 ! Use EBT to get vertical structure first and then re-calculate cg1 using first baroclinic mode
183- call wave_speed(h, tv, G, GV, US, CS% cg1, CS% wave_speed_CSp, modal_structure= CS% ebt_struct, use_ebt_mode= .true. )
183+ call wave_speed(h, tv, G, GV, US, CS% cg1, CS% wave_speed_CSp, modal_structure= CS% ebt_struct, &
184+ use_ebt_mode= .true. )
184185 call wave_speed(h, tv, G, GV, US, CS% cg1, CS% wave_speed_CSp)
185186 endif
186187 call pass_var(CS% ebt_struct, G% Domain)
@@ -729,43 +730,51 @@ end subroutine calc_slope_functions_using_just_e
729730! > Calculates the Leith Laplacian and bi-harmonic viscosity coefficients
730731subroutine calc_QG_Leith_viscosity (CS , G , GV , h , k , div_xx_dx , div_xx_dy , vort_xy_dx , vort_xy_dy )
731732 type (VarMix_CS), pointer :: CS ! < Variable mixing coefficients
732- type (ocean_grid_type), intent (in ) :: G ! < Ocean grid structure
733+ type (ocean_grid_type), intent (in ) :: G ! < Ocean grid structure
733734 type (verticalGrid_type), intent (in ) :: GV ! < The ocean's vertical grid structure.
734- ! real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< Zonal flow (m s-1)
735- ! real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< Meridional flow (m s-1)
736- real , dimension (SZI_(G),SZJ_(G),SZK_(G)), intent (inout ) :: h ! < Layer thickness (m or kg m-2)
737- integer , intent (in ) :: k ! < Layer for which to calculate vorticity magnitude
738- real , dimension (SZIB_(G),SZJ_(G)), intent (in ) :: div_xx_dx ! < x-derivative of horizontal divergence (d/dx(du/dx + dv/dy)) (m-1 s-1)
739- real , dimension (SZI_(G),SZJB_(G)), intent (in ) :: div_xx_dy ! < y-derivative of horizontal divergence (d/dy(du/dx + dv/dy)) (m-1 s-1)
740- real , dimension (SZI_(G),SZJB_(G)), intent (inout ) :: vort_xy_dx ! < x-derivative of vertical vorticity (d/dx(dv/dx - du/dy)) (m-1 s-1)
741- real , dimension (SZIB_(G),SZJ_(G)), intent (inout ) :: vort_xy_dy ! < y-derivative of vertical vorticity (d/dy(dv/dx - du/dy)) (m-1 s-1)
742- ! real, dimension(SZI_(G),SZJ_(G)), intent(out) :: Leith_Kh_h !< Leith Laplacian viscosity at h-points (m2 s-1)
743- ! real, dimension(SZIB_(G),SZJB_(G)), intent(out) :: Leith_Kh_q !< Leith Laplacian viscosity at q-points (m2 s-1)
744- ! real, dimension(SZI_(G),SZJ_(G)), intent(out) :: Leith_Ah_h !< Leith bi-harmonic viscosity at h-points (m4 s-1)
745- ! real, dimension(SZIB_(G),SZJB_(G)), intent(out) :: Leith_Ah_q !< Leith bi-harmonic viscosity at q-points (m4 s-1)
735+ ! real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< Zonal flow [m s-1]
736+ ! real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< Meridional flow [m s-1]
737+ real , dimension (SZI_(G),SZJ_(G),SZK_(G)), intent (inout ) :: h ! < Layer thickness [H ~> m or kg m-2]
738+ integer , intent (in ) :: k ! < Layer for which to calculate vorticity magnitude
739+ real , dimension (SZIB_(G),SZJ_(G)), intent (in ) :: div_xx_dx ! < x-derivative of horizontal divergence
740+ ! ! (d/dx(du/dx + dv/dy)) [m-1 s-1]
741+ real , dimension (SZI_(G),SZJB_(G)), intent (in ) :: div_xx_dy ! < y-derivative of horizontal divergence
742+ ! ! (d/dy(du/dx + dv/dy)) [m-1 s-1]
743+ real , dimension (SZI_(G),SZJB_(G)), intent (inout ) :: vort_xy_dx ! < x-derivative of vertical vorticity
744+ ! ! (d/dx(dv/dx - du/dy)) [m-1 s-1]
745+ real , dimension (SZIB_(G),SZJ_(G)), intent (inout ) :: vort_xy_dy ! < y-derivative of vertical vorticity
746+ ! ! (d/dy(dv/dx - du/dy)) [m-1 s-1]
747+ ! real, dimension(SZI_(G),SZJ_(G)), intent(out) :: Leith_Kh_h !< Leith Laplacian viscosity
748+ ! ! at h-points [m2 s-1]
749+ ! real, dimension(SZIB_(G),SZJB_(G)), intent(out) :: Leith_Kh_q !< Leith Laplacian viscosity
750+ ! ! at q-points [m2 s-1]
751+ ! real, dimension(SZI_(G),SZJ_(G)), intent(out) :: Leith_Ah_h !< Leith bi-harmonic viscosity
752+ ! ! at h-points [m4 s-1]
753+ ! real, dimension(SZIB_(G),SZJB_(G)), intent(out) :: Leith_Ah_q !< Leith bi-harmonic viscosity
754+ ! ! at q-points [m4 s-1]
746755
747756 ! Local variables
748- ! real, dimension(SZIB_(G),SZJB_(G)) :: vort_xy, & ! Vertical vorticity (dv/dx - du/dy) ( s-1)
749- ! dudy, & ! Meridional shear of zonal velocity ( s-1)
750- ! dvdx ! Zonal shear of meridional velocity ( s-1)
757+ ! real, dimension(SZIB_(G),SZJB_(G)) :: vort_xy, & ! Vertical vorticity (dv/dx - du/dy) [ s-1]
758+ ! dudy, & ! Meridional shear of zonal velocity [ s-1]
759+ ! dvdx ! Zonal shear of meridional velocity [ s-1]
751760 real , dimension (SZI_(G),SZJB_(G)) :: &
752- ! vort_xy_dx, & ! x-derivative of vertical vorticity (d/dx(dv/dx - du/dy)) ( m-1 s-1)
753- ! div_xx_dy, & ! y-derivative of horizontal divergence (d/dy(du/dx + dv/dy)) ( m-1 s-1)
754- dslopey_dz, & ! z-derivative of y-slope at v-points ( m-1)
755- h_at_v, & ! Thickness at v-points ( m or kg m-2)
756- beta_v, & ! Beta at v-points ( m-1 s-1)
757- grad_vort_mag_v, & ! mag. of vort. grad. at v-points ( s-1)
758- grad_div_mag_v ! mag. of div. grad. at v-points ( s-1)
761+ ! vort_xy_dx, & ! x-derivative of vertical vorticity (d/dx(dv/dx - du/dy)) [ m-1 s-1]
762+ ! div_xx_dy, & ! y-derivative of horizontal divergence (d/dy(du/dx + dv/dy)) [ m-1 s-1]
763+ dslopey_dz, & ! z-derivative of y-slope at v-points [ m-1]
764+ h_at_v, & ! Thickness at v-points [H ~> m or kg m-2]
765+ beta_v, & ! Beta at v-points [ m-1 s-1]
766+ grad_vort_mag_v, & ! mag. of vort. grad. at v-points [ s-1]
767+ grad_div_mag_v ! mag. of div. grad. at v-points [ s-1]
759768
760769 real , dimension (SZIB_(G),SZJ_(G)) :: &
761- ! vort_xy_dy, & ! y-derivative of vertical vorticity (d/dy(dv/dx - du/dy)) ( m-1 s-1)
762- ! div_xx_dx, & ! x-derivative of horizontal divergence (d/dx(du/dx + dv/dy)) ( m-1 s-1)
770+ ! vort_xy_dy, & ! y-derivative of vertical vorticity (d/dy(dv/dx - du/dy)) [ m-1 s-1]
771+ ! div_xx_dx, & ! x-derivative of horizontal divergence (d/dx(du/dx + dv/dy)) [ m-1 s-1]
763772 dslopex_dz, & ! z-derivative of x-slope at u-points (m-1)
764- h_at_u, & ! Thickness at u-points ( m or kg m-2)
765- beta_u, & ! Beta at u-points ( m-1 s-1)
766- grad_vort_mag_u, & ! mag. of vort. grad. at u-points ( s-1)
767- grad_div_mag_u ! mag. of div. grad. at u-points ( s-1)
768- ! real, dimension(SZI_(G),SZJ_(G)) :: div_xx ! Estimate of horizontal divergence at h-points ( s-1)
773+ h_at_u, & ! Thickness at u-points [H ~> m or kg m-2]
774+ beta_u, & ! Beta at u-points [ m-1 s-1]
775+ grad_vort_mag_u, & ! mag. of vort. grad. at u-points [ s-1]
776+ grad_div_mag_u ! mag. of div. grad. at u-points [ s-1]
777+ ! real, dimension(SZI_(G),SZJ_(G)) :: div_xx ! Estimate of horizontal divergence at h-points [ s-1]
769778! real :: mod_Leith, DY_dxBu, DX_dyBu, vert_vort_mag
770779 real :: h_at_slope_above, h_at_slope_below, Ih, f
771780 integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq,nz
0 commit comments