source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90 @ 7061

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

Enable 3D tracer trends diagnostics ,ie. diagnostics obtained for ln_tra_trd=T, in UKMO/dev_r5518_GO6_package branch.
Remove error check for VVL and implement thickness weighting.
Also implement new diagnostics:
ttrd_totad : the total trend due to advection (correct alternative to ttrd_ad!)
ttrd_iso_x/y/z1 : individual components of trend due to isopycnal diffusion. Note the "z1" diagnostic is only part of the vertical trend. The other part is ttrd_zdf minus ttrd_zdfp.
ttrd_evd : the trend due to the EVD convection term (which is contained in ttrd_zdf and ttrd_zdfp).
ttrd_tot : the total model trend.
u/v/weiv_masstr3d : the components of the mass transport due to the Gent-Mc Williams? scheme.
u/v/weiv_heattr3d : the components of the heat transport due to the Gent-Mc Williams? scheme.
u/v/weiv_salttr3d : the components of the salt transport due to the Gent-Mc Williams? scheme.

File size: 6.1 KB
Line 
1MODULE zdfevd
2   !!======================================================================
3   !!                       ***  MODULE  zdfevd  ***
4   !! Ocean physics: parameterization of convection through an enhancement
5   !!                of vertical eddy mixing coefficient
6   !!======================================================================
7   !! History :  OPA  !  1997-06  (G. Madec, A. Lazar)  Original code
8   !!   NEMO     1.0  !  2002-06  (G. Madec)  F90: Free form and module
9   !!             -   !  2005-06  (C. Ethe) KPP parameterization
10   !!            3.2  !  2009-03  (M. Leclair, G. Madec, R. Benshila) test on both before & after
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   zdf_evd      : increase the momentum and tracer Kz at the location of
15   !!                  statically unstable portion of the water column (ln_zdfevd=T)
16   !!----------------------------------------------------------------------
17   USE oce             ! ocean dynamics and tracers variables
18   USE dom_oce         ! ocean space and time domain variables
19   USE zdf_oce         ! ocean vertical physics variables
20   USE zdfkpp          ! KPP vertical mixing
21   USE trd_oce         ! trends: ocean variables
22   USE trdtra          ! trends manager: tracers
23   USE in_out_manager  ! I/O manager
24   USE iom             ! for iom_put
25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
26   USE timing          ! Timing
27
28   IMPLICIT NONE
29   PRIVATE
30
31   PUBLIC   zdf_evd    ! called by step.F90
32
33   !! * Substitutions
34#  include "domzgr_substitute.h90"
35   !!----------------------------------------------------------------------
36   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
37   !! $Id$
38   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
39   !!----------------------------------------------------------------------
40CONTAINS
41
42   SUBROUTINE zdf_evd( kt )
43      !!----------------------------------------------------------------------
44      !!                  ***  ROUTINE zdf_evd  ***
45      !!                   
46      !! ** Purpose :   Local increased the vertical eddy viscosity and diffu-
47      !!      sivity coefficients when a static instability is encountered.
48      !!
49      !! ** Method  :   avt, avm, and the 4 neighbouring avmu, avmv coefficients
50      !!      are set to avevd (namelist parameter) if the water column is
51      !!      statically unstable (i.e. if rn2 < -1.e-12 )
52      !!
53      !! ** Action  :   avt, avm, avmu, avmv updted in static instability cases
54      !!
55      !! References :   Lazar, A., these de l'universite Paris VI, France, 1997
56      !!----------------------------------------------------------------------
57      USE oce,   zavt_evd => ua , zavm_evd => va  ! (ua,va) used ua workspace
58      !
59      INTEGER, INTENT( in ) ::   kt   ! ocean time-step indexocean time step
60      !
61      INTEGER ::   ji, jj, jk   ! dummy loop indices
62      !!----------------------------------------------------------------------
63      !
64      IF( nn_timing == 1 )  CALL timing_start('zdf_evd')
65      !
66      IF( kt == nit000 ) THEN
67         IF(lwp) WRITE(numout,*)
68         IF(lwp) WRITE(numout,*) 'zdf_evd : Enhanced Vertical Diffusion (evd)'
69         IF(lwp) WRITE(numout,*) '~~~~~~~ '
70         IF(lwp) WRITE(numout,*)
71      ENDIF
72
73      zavt_evd(:,:,:) = avt(:,:,:)           ! set avt prior to evd application
74
75      SELECT CASE ( nn_evdm )
76      !
77      CASE ( 1 )           ! enhance vertical eddy viscosity and diffusivity (if rn2<-1.e-12)
78         !
79         zavm_evd(:,:,:) = avm(:,:,:)           ! set avm prior to evd application
80         !
81         DO jk = 1, jpkm1 
82            DO jj = 2, jpj             ! no vector opt.
83               DO ji = 2, jpi
84#if defined key_zdfkpp
85                  ! no evd mixing in the boundary layer with KPP
86                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12  .AND.  fsdepw(ji,jj,jk) > hkpp(ji,jj)  ) THEN
87#else
88                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) THEN
89#endif
90                     avt (ji  ,jj  ,jk) = rn_avevd * tmask(ji  ,jj  ,jk)
91                     avm (ji  ,jj  ,jk) = rn_avevd * tmask(ji  ,jj  ,jk)
92                     avmu(ji  ,jj  ,jk) = rn_avevd * umask(ji  ,jj  ,jk)
93                     avmu(ji-1,jj  ,jk) = rn_avevd * umask(ji-1,jj  ,jk)
94                     avmv(ji  ,jj  ,jk) = rn_avevd * vmask(ji  ,jj  ,jk)
95                     avmv(ji  ,jj-1,jk) = rn_avevd * vmask(ji  ,jj-1,jk)
96                  ENDIF
97               END DO
98            END DO
99         END DO
100         CALL lbc_lnk( avt , 'W', 1. )   ;   CALL lbc_lnk( avm , 'W', 1. )   ! Lateral boundary conditions
101         CALL lbc_lnk( avmu, 'U', 1. )   ;   CALL lbc_lnk( avmv, 'V', 1. )
102         !
103         zavm_evd(:,:,:) = avm(:,:,:) - zavm_evd(:,:,:)   ! change in avm due to evd
104         CALL iom_put( "avm_evd", zavm_evd )              ! output this change
105         !
106      CASE DEFAULT         ! enhance vertical eddy diffusivity only (if rn2<-1.e-12)
107         DO jk = 1, jpkm1
108!!!         WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd   ! agissant sur T SEUL!
109            DO jj = 1, jpj             ! loop over the whole domain (no lbc_lnk call)
110               DO ji = 1, jpi
111#if defined key_zdfkpp
112                  ! no evd mixing in the boundary layer with KPP
113                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12  .AND.  fsdepw(ji,jj,jk) > hkpp(ji,jj)  )   &         
114#else
115                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 )   &
116#endif
117                     avt(ji,jj,jk) = rn_avevd * tmask(ji,jj,jk)
118               END DO
119            END DO
120         END DO
121         !
122      END SELECT
123
124      zavt_evd(:,:,:) = avt(:,:,:) - zavt_evd(:,:,:)   ! change in avt due to evd
125      CALL iom_put( "avt_evd", zavt_evd )              ! output this change
126      IF( l_trdtra ) CALL trd_tra( kt, 'TRA', jp_tem, jptra_evd, zavt_evd )
127      !
128      IF( nn_timing == 1 )  CALL timing_stop('zdf_evd')
129      !
130   END SUBROUTINE zdf_evd
131
132   !!======================================================================
133END MODULE zdfevd
Note: See TracBrowser for help on using the repository browser.