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.
trazdf_exp.F90 in branches/dev_001_GM/NEMO/OPA_SRC/TRA – NEMO

source: branches/dev_001_GM/NEMO/OPA_SRC/TRA/trazdf_exp.F90 @ 786

Last change on this file since 786 was 786, checked in by gm, 16 years ago

dev_001_GM - merge TRC-TRA on OPA only, trabbl & zpshde not done and trdmld not OK - compilation OK

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.7 KB
Line 
1MODULE trazdf_exp
2   !!==============================================================================
3   !!                    ***  MODULE  trazdf_exp  ***
4   !! Ocean active tracers:  vertical component of the tracer mixing trend using
5   !!                        an explicit time-stepping (time spllitting scheme)
6   !!==============================================================================
7   !! History :  6.0  !  1990-10  (B. Blanke)  Original code
8   !!            7.0  !  1991-11  (G. Madec)
9   !!                 !  1992-06  (M. Imbard)  correction on tracer trend loops
10   !!                 !  1996-01  (G. Madec)  statement function for e3
11   !!                 !  1997-05  (G. Madec)  vertical component of isopycnal
12   !!                 !  1997-07  (G. Madec)  geopotential diffusion in s-coord
13   !!                 !  2000-08  (G. Madec)  double diffusive mixing
14   !!   NEMO     1.0  !  2002-08  (G. Madec)  F90: Free form and module
15   !!             -   !  2004-08  (C. Talandier) New trends organisation
16   !!            2.0  !  2005-11  (G. Madec)  New organisation
17   !!            2.4  !  2008-01  (G. Madec) Merge TRA-TRC
18   !!----------------------------------------------------------------------
19
20   !!----------------------------------------------------------------------
21   !!   tra_zdf_exp  : update the tracer trend with the vertical diffusion
22   !!                  using an explicit time stepping
23   !!----------------------------------------------------------------------
24   USE dom_oce         ! ocean space and time domain
25   USE zdf_oce         ! ocean vertical physics
26   USE in_out_manager  ! I/O manager
27
28   IMPLICIT NONE
29   PRIVATE
30
31   PUBLIC tra_zdf_exp          ! routine called by step.F90
32
33   !! * Substitutions
34#  include "domzgr_substitute.h90"
35#  include "vectopt_loop_substitute.h90"
36   !!----------------------------------------------------------------------
37   !!  OPA 9.0 , LOCEAN-IPSL (2005)
38   !! $Header$
39   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
40   !!----------------------------------------------------------------------
41
42CONTAINS
43
44   SUBROUTINE tra_zdf_exp( kt, p2dt, pavt, ptb , pta   )
45      !!----------------------------------------------------------------------
46      !!                  ***  ROUTINE tra_zdf_exp  ***
47      !!                   
48      !! ** Purpose :   Compute the trend due to the vertical tracer mixing
49      !!      using an explicit time stepping and add it to the general trend
50      !!      of the tracer equations.
51      !!
52      !! ** Method  :   The vertical diffusion of tracers (t & s) is given by:
53      !!         difft = dz( avt dz(tb) ) = 1/e3t dk+1( avt/e3w dk(tb) )
54      !!      It is evaluated with an Euler scheme, using a time splitting
55      !!      technique.
56      !!      Surface and bottom boundary conditions: no diffusive flux on
57      !!      both tracers (bottom, applied through the masked field avt).
58      !!      Add this trend to the general trend ta,sa :
59      !!          ta = ta + dz( avt dz(t) )
60      !!         (sa = sa + dz( avs dz(t) ) if lk_zdfddm= T)
61      !!
62      !! ** Action : - Update (ta,sa) with the before vertical diffusion trend
63      !!
64      !!---------------------------------------------------------------------
65      INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
66      REAL(wp), INTENT(in   ), DIMENSION(jpk)         ::   p2dt   ! vertical profile of tracer time-step
67      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   pavt   ! eddy diffusivity coef.
68      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   ptb    ! before tracer field
69      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer trend
70      !!
71      INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices
72      REAL(wp) ::   zlavmr, zave3r, ze3tr, zta   !    "         "
73      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zwy
74      !!---------------------------------------------------------------------
75
76      IF( kt == nit000 ) THEN
77         IF(lwp) WRITE(numout,*)
78         IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing (j-k-i loops)'
79         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
80      ENDIF
81
82
83      ! 0. Local constant initialization
84      ! --------------------------------
85      zlavmr = 1. / FLOAT( n_zdfexp )
86
87      ! 1. Initializations
88      ! ------------------
89      zwy(:,:, 1 ) = 0.e0          ! surface : zero diffusive flux
90      zwy(:,:,jpk) = 0.e0          ! bottom  : zero diffusive flux
91      zwx(:,:,:) = ptb(:,:,:)      ! interior: start from before tracer
92
93
94      ! 2. Time splitting loop
95      ! ----------------------
96
97      DO jl = 1, n_zdfexp
98         !
99         ! first vertical derivative
100         DO jk = 2, jpk
101            DO jj = 2, jpjm1
102               DO ji = fs_2, fs_jpim1      ! vector opt.
103                  zave3r = 1.e0 / fse3w(ji,jj,jk) 
104                  zwy(ji,jj,jk) =  pavt(ji,jj,jk) * ( zwx(ji,jj,jk-1) - zwx(ji,jj,jk) ) * zave3r
105               END DO
106            END DO
107         END DO
108
109         ! trend estimation at kt+l*2*rdt/n_zdfexp
110         DO jk = 1, jpkm1
111            DO jj = 2, jpjm1
112               DO ji = fs_2, fs_jpim1      ! vector opt.
113                  ze3tr = zlavmr / fse3t(ji,jj,jk)
114                  ! 2nd vertical derivative
115                  zta = ( zwy(ji,jj,jk) - zwy(ji,jj,jk+1) ) * ze3tr
116                  ! update the tracer trends
117                  pta(ji,jj,jk) = pta(ji,jj,jk) + zta
118                  ! update tracer fields at kt+l*2*rdt/n_zdfexp
119                  zwx(ji,jj,jk) = zwx(ji,jj,jk) + p2dt(jk) * zta * tmask(ji,jj,jk)
120               END DO
121            END DO
122         END DO
123         !
124      END DO 
125      !
126   END SUBROUTINE tra_zdf_exp
127
128   !!==============================================================================
129END MODULE trazdf_exp
Note: See TracBrowser for help on using the repository browser.