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.
ldftra.F90 in trunk/NEMO/OPA_SRC/LDF – NEMO

source: trunk/NEMO/OPA_SRC/LDF/ldftra.F90 @ 473

Last change on this file since 473 was 461, checked in by opalod, 18 years ago

nemo_v1_update_052:RB: update lateral diffusion computation following the reorganization of both dynamics and tracers

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.5 KB
Line 
1MODULE ldftra
2   !!======================================================================
3   !!                       ***  MODULE  ldftra  ***
4   !! Ocean physics:  lateral diffusivity coefficient
5   !!=====================================================================
6   !! History :
7   !!        !  07-97  (G. Madec)  from inimix.F split in 2 routines
8   !!        !  08-97  (G. Madec)  multi dimensional coefficients
9   !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
10   !!   9.0  !  05-11  (G. Madec) 
11   !!----------------------------------------------------------------------
12   !!   ldf_tra_init : initialization, namelist read, and parameters control
13   !!   ldf_tra_c3d   : 3D eddy viscosity coefficient initialization
14   !!   ldf_tra_c2d   : 2D eddy viscosity coefficient initialization
15   !!   ldf_tra_c1d   : 1D eddy viscosity coefficient initialization
16   !!----------------------------------------------------------------------
17   !! * Modules used
18   USE oce             ! ocean dynamics and tracers
19   USE dom_oce         ! ocean space and time domain
20   USE phycst          ! physical constants
21   USE ldftra_oce      ! ocean tracer   lateral physics
22   USE ldfslp          ! ???
23   USE in_out_manager  ! I/O manager
24   USE lib_mpp         ! distribued memory computing library
25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
26
27   IMPLICIT NONE
28   PRIVATE
29
30   !! *  Routine accessibility
31   PUBLIC ldf_tra_init   ! called by opa.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 ldf_tra_init
45      !!----------------------------------------------------------------------
46      !!                  ***  ROUTINE ldf_tra_init  ***
47      !!
48      !! ** Purpose :   initializations of the tracer lateral mixing coeff.
49      !!
50      !! ** Method  :   the Eddy diffusivity and eddy induced velocity ceoff.
51      !!      are defined as follows:
52      !!         default option   : constant coef. aht0, aeiv0 (namelist)
53      !!        'key_traldf_c1d': depth dependent coef. defined in
54      !!                            in ldf_tra_c1d routine
55      !!        'key_traldf_c2d': latitude and longitude dependent coef.
56      !!                            defined in ldf_tra_c2d routine
57      !!        'key_traldf_c3d': latitude, longitude, depth dependent coef.
58      !!                            defined in ldf_tra_c3d routine
59      !!
60      !!      N.B. User defined include files.  By default, 3d and 2d coef.
61      !!      are set to a constant value given in the namelist and the 1d
62      !!      coefficients are initialized to a hyperbolic tangent vertical
63      !!      profile.
64      !!
65      !!----------------------------------------------------------------------
66      USE ioipsl
67
68      INTEGER ::   ioptio               ! ???
69      LOGICAL ::   ll_print = .FALSE.   ! =T print eddy coef. in numout
70       
71      NAMELIST/nam_traldf/ ln_traldf_lap  , ln_traldf_bilap,                &
72         &                 ln_traldf_level, ln_traldf_hor, ln_traldf_iso,   &
73         &                 aht0, ahtb0, aeiv0
74      !!----------------------------------------------------------------------
75
76      !  Define the lateral tracer physics parameters
77      ! =============================================
78   
79      ! Read Namelist nam_traldf : Lateral physics on tracers
80      REWIND( numnam )
81      READ  ( numnam, nam_traldf )
82
83      IF(lwp) THEN
84         WRITE(numout,*)
85         WRITE(numout,*) 'ldf_tra_init : lateral tracer physics'
86         WRITE(numout,*) '~~~~~~~~~~~~ '
87         WRITE(numout,*) '          Namelist nam_traldf : lateral mixing coefficients'
88         WRITE(numout,*) '             laplacian operator          ln_traldf_lap   = ', ln_traldf_lap
89         WRITE(numout,*) '             bilaplacian operator        ln_traldf_bilap = ', ln_traldf_bilap
90         WRITE(numout,*) '             lateral eddy diffusivity             aht0   = ', aht0
91         WRITE(numout,*) '             background hor. diffusivity          ahtb0  = ', ahtb0
92         WRITE(numout,*) '             eddy induced velocity coef.          aeiv0  = ', aeiv0
93         WRITE(numout,*)
94      ENDIF
95
96      ! Parameter control
97
98      ! ... Check consistency for type and direction :
99      !           ==> will be done in traldf module
100
101      ! ... Space variation of eddy coefficients
102      ioptio = 0
103#if defined key_traldf_c3d
104      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude, depth)'
105      ioptio = ioptio + 1
106#endif
107#if defined key_traldf_c2d
108      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude)'
109      ioptio = ioptio + 1
110#endif
111#if defined key_traldf_c1d
112      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( depth )'
113      ioptio = ioptio + 1
114      IF( .NOT. ln_zco ) THEN
115         IF(lwp) WRITE(numout,cform_err)
116         IF(lwp) WRITE(numout,*) '          key_traldf_c1d can only be used in z-coordinate - full step'
117         nstop = nstop + 1
118      ENDIF
119#endif
120      IF( ioptio == 0 ) THEN
121          IF(lwp) WRITE(numout,*) '          tracer mixing coef. = constant (default option)'
122        ELSEIF( ioptio > 1 ) THEN
123          IF(lwp) WRITE(numout,cform_err)
124          IF(lwp) WRITE(numout,*) '          use only one of the following keys:',   &
125             &                    ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d'
126          nstop = nstop + 1
127      ENDIF
128
129      IF( ln_traldf_bilap ) THEN
130         IF(lwp) WRITE(numout,*) '          biharmonic tracer diffusion'
131         IF( aht0 > 0 .AND. .NOT. lk_esopa ) THEN
132            IF(lwp) WRITE(numout,cform_err)
133            IF(lwp) WRITE(numout,*) '          The horizontal diffusivity coef. aht0 must be negative'
134            nstop = nstop + 1
135         ENDIF
136      ELSE
137         IF(lwp) WRITE(numout,*) '          harmonic tracer diffusion (default)'
138         IF( aht0 < 0 .AND. .NOT. lk_esopa ) THEN
139            IF(lwp) WRITE(numout,cform_err)
140            IF(lwp) WRITE(numout,*) '          The horizontal diffusivity coef. aht0 must be positive'
141            nstop = nstop + 1
142         ENDIF
143      ENDIF
144
145
146      !  Lateral eddy diffusivity and eddy induced velocity coefficients
147      ! ================================================================
148
149#if defined key_traldf_c3d
150      CALL ldf_tra_c3d( ll_print )      ! aht = 3D coef. = F( longitude, latitude, depth )
151#elif defined key_traldf_c2d
152      CALL ldf_tra_c2d( ll_print )      ! aht = 2D coef. = F( longitude, latitude )
153#elif defined key_traldf_c1d
154      CALL ldf_tra_c1d( ll_print )      ! aht = 1D coef. = F( depth )
155#else
156                                        ! Constant coefficients
157      IF(lwp)WRITE(numout,*)
158      IF(lwp)WRITE(numout,*) '          constant eddy diffusivity coef.   ahtu = ahtv = ahtw = aht0 = ', aht0
159      IF( lk_traldf_eiv ) THEN
160         IF(lwp)WRITE(numout,*)
161         IF(lwp)WRITE(numout,*) '          constant eddy induced velocity coef.   aeiu = aeiv = aeiw = aeiv0 = ', aeiv0
162      ENDIF
163#endif
164
165   END SUBROUTINE ldf_tra_init
166
167#if defined key_traldf_c3d
168#   include "ldftra_c3d.h90"
169#elif defined key_traldf_c2d
170#   include "ldftra_c2d.h90"
171#elif defined key_traldf_c1d
172#   include "ldftra_c1d.h90"
173#endif
174
175   !!======================================================================
176END MODULE ldftra
Note: See TracBrowser for help on using the repository browser.