New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
zdfsh2.F90 in NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF – NEMO

source: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdfsh2.F90 @ 10883

Last change on this file since 10883 was 10883, checked in by davestorkey, 5 years ago

branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps: some of the ocean physics modules.

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1MODULE zdfsh2
2   !!======================================================================
3   !!                       ***  MODULE  zdfsh2  ***
4   !! Ocean physics:  shear production term of TKE
5   !!=====================================================================
6   !! History :   -   !  2014-10  (A. Barthelemy, G. Madec)  original code
7   !!   NEMO     4.0  !  2017-04  (G. Madec)  remove u-,v-pts avm
8   !!----------------------------------------------------------------------
9
10   !!----------------------------------------------------------------------
11   !!   zdf_sh2       : compute mixing the shear production term of TKE
12   !!----------------------------------------------------------------------
13   USE oce
14   USE dom_oce        ! domain: ocean
15   !
16   USE in_out_manager ! I/O manager
17   USE lib_mpp        ! MPP library
18
19   IMPLICIT NONE
20   PRIVATE
21
22   PUBLIC   zdf_sh2        ! called by zdftke, zdfglf, and zdfric
23   
24   !!----------------------------------------------------------------------
25   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
26   !! $Id$
27   !! Software governed by the CeCILL license (see ./LICENSE)
28   !!----------------------------------------------------------------------
29CONTAINS
30
31   SUBROUTINE zdf_sh2( Kbb, Kmm, p_avm, p_sh2  ) 
32      !!----------------------------------------------------------------------
33      !!                   ***  ROUTINE zdf_sh2  ***
34      !!
35      !! ** Purpose :   Compute the shear production term of a TKE equation
36      !!
37      !! ** Method  : - a stable discretization of this term is linked to the
38      !!                time-space discretization of the vertical diffusion
39      !!                of the OGCM. NEMO uses C-grid, a leap-frog environment
40      !!                and an implicit computation of vertical mixing term,
41      !!                so the shear production at w-point is given by:
42      !!                   sh2 = mi[   mi(avm) * dk[ub]/e3ub * dk[un]/e3un   ]
43      !!                       + mj[   mj(avm) * dk[vb]/e3vb * dk[vn]/e3vn   ]
44      !!                NB: wet-point only horizontal averaging of shear
45      !!
46      !! ** Action  : - p_sh2 shear prod. term at w-point (inner domain only)
47      !!                                                   *****
48      !! References :   Bruchard, OM 2002
49      !! ---------------------------------------------------------------------
50      INTEGER                    , INTENT(in   ) ::   Kbb, Kmm             ! ocean time level indices
51      REAL(wp), DIMENSION(:,:,:) , INTENT(in   ) ::   p_avm                ! vertical eddy viscosity (w-points)
52      REAL(wp), DIMENSION(:,:,:) , INTENT(  out) ::   p_sh2                ! shear production of TKE (w-points)
53      !
54      INTEGER  ::   ji, jj, jk   ! dummy loop arguments
55      REAL(wp), DIMENSION(jpi,jpj) ::   zsh2u, zsh2v   ! 2D workspace
56      !!--------------------------------------------------------------------
57      !
58      DO jk = 2, jpkm1
59         DO jj = 1, jpjm1        !* 2 x shear production at uw- and vw-points (energy conserving form)
60            DO ji = 1, jpim1
61               zsh2u(ji,jj) = ( p_avm(ji+1,jj,jk) + p_avm(ji,jj,jk) ) &
62                  &         * (   uu(ji,jj,jk-1,Kmm) -   uu(ji,jj,jk,Kmm) ) &
63                  &         * (   uu(ji,jj,jk-1,Kbb) -   uu(ji,jj,jk,Kbb) ) / ( e3uw(ji,jj,jk,Kmm) * e3uw(ji,jj,jk,Kbb) ) * wumask(ji,jj,jk)
64               zsh2v(ji,jj) = ( p_avm(ji,jj+1,jk) + p_avm(ji,jj,jk) ) &
65                  &         * (   vv(ji,jj,jk-1,Kmm) -   vv(ji,jj,jk,Kmm) ) &
66                  &         * (   vv(ji,jj,jk-1,Kbb) -   vv(ji,jj,jk,Kbb) ) / ( e3vw(ji,jj,jk,Kmm) * e3vw(ji,jj,jk,Kbb) ) * wvmask(ji,jj,jk)
67            END DO
68         END DO
69         DO jj = 2, jpjm1        !* shear production at w-point
70            DO ji = 2, jpim1           ! coast mask: =2 at the coast ; =1 otherwise (NB: wmask useless as zsh2 are masked)
71               p_sh2(ji,jj,jk) = 0.25 * (   ( zsh2u(ji-1,jj) + zsh2u(ji,jj) ) * ( 2. - umask(ji-1,jj,jk) * umask(ji,jj,jk) )   &
72                  &                       + ( zsh2v(ji,jj-1) + zsh2v(ji,jj) ) * ( 2. - vmask(ji,jj-1,jk) * vmask(ji,jj,jk) )   )
73            END DO
74         END DO
75      END DO 
76      !
77   END SUBROUTINE zdf_sh2
78
79   !!======================================================================
80END MODULE zdfsh2
Note: See TracBrowser for help on using the repository browser.