Blame view

src/meanflow/shear.F90 3.5 KB
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 !$Id: shear.F90,v 1.1 2005-06-27 10:54:33 kbk Exp$ #include"cppdefs.h" !----------------------------------------------------------------------- !BOP ! ! !ROUTINE: Calculation of the vertical shear \label{sec:shear} ! ! !INTERFACE: subroutine shear(nlev,cnpar) ! ! !DESCRIPTION: ! The (square of the) shear frequency is defined as ! $$! \label{MSquared} ! M^2 = \left( \partder{U}{z} \right)^2 + ! \left( \partder{V}{z} \right)^2 ! \point !$$ ! It is an important parameter in almost all turbulence models. ! The $U$- and $V$-contributions to $M^2$ are computed using a new scheme ! which guarantees conservation of kinetic energy for the convertion ! from mean to turbulent kinetic energy, see \cite{Burchard2002}. With this method, ! the discretisation of the $U$-contribution can be written as ! $$! \label{shearsquared} ! \left( \partder{U}{z} \right)^2 \approx \frac{(\bar U_{j+1}-\bar U_j) ! (\tilde U_{j+1}-\tilde U_j)}{(z_{j+1}-z_j)^2} !$$ ! where $\tilde U_j=\frac12(\hat U_j+U_j)$. The $V$-contribution is computed analogously. ! The shear obtained from \eq{shearsquared} ! plus the $V$-contribution is then used for the computation of the turbulence ! shear production, see equation \eq{computeP}. ! ! !USES: use meanflow, only: h,u,v,uo,vo use meanflow, only: SS,SSU,SSV IMPLICIT NONE ! ! !INPUT PARAMETERS: ! number of vertical layers integer, intent(in) :: nlev ! numerical "implicitness" parameter REALTYPE, intent(in) :: cnpar ! ! !REVISION HISTORY: ! Original author(s): Lars Umlauf ! ! $Log: shear.F90,v$ ! Revision 1.1 2005-06-27 10:54:33 kbk ! new files needed ! ! !EOP ! ! !LOCAL VARIABLES: integer :: i ! !----------------------------------------------------------------------- !BOC ! Discretisation of vertical shear squared according to Burchard (2002) ! in order to guarantee conservation of kinetic energy when transformed ! from mean kinetic energy to turbulent kinetic energy. do i=1,nlev-1 SSU(i)= 0.5*( & (cnpar*(u(i+1)-u(i))*(u(i+1)-uo(i))+ & (1.-cnpar)*(uo(i+1)-uo(i))*(uo(i+1)-u(i))) & /(0.5*(h(i+1)+h(i)))/h(i) & +(cnpar*(u(i+1)-u(i))*(uo(i+1)-u(i))+ & (1.-cnpar)*(uo(i+1)-uo(i))*(u(i+1)-uo(i))) & /(0.5*(h(i+1)+h(i)))/h(i+1) & ) SSV(i)= 0.5*( & (cnpar*(v(i+1)-v(i))*(v(i+1)-vo(i))+ & (1.-cnpar)*(vo(i+1)-vo(i))*(vo(i+1)-v(i))) & /(0.5*(h(i+1)+h(i)))/h(i) & +(cnpar*(v(i+1)-v(i))*(vo(i+1)-v(i))+ & (1.-cnpar)*(vo(i+1)-vo(i))*(v(i+1)-vo(i))) & /(0.5*(h(i+1)+h(i)))/h(i+1) & ) SS(i) = SSU(i) + SSV(i) end do SSU(0 ) = SSU(1 ) SSU(nlev) = SSU(nlev-1) SSV(0 ) = SSV(1 ) SSV(nlev) = SSV(nlev-1) SS (0 ) = SS (1 ) SS (nlev) = SS (nlev-1) return end subroutine shear !EOC !----------------------------------------------------------------------- ! Copyright by the GOTM-team under the GNU Public License - www.gnu.org !-----------------------------------------------------------------------