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/OFF_SRC/LDF – NEMO

source: trunk/NEMO/OFF_SRC/LDF/ldftra.F90 @ 1124

Last change on this file since 1124 was 1124, checked in by cetlod, 16 years ago

style of all top namelist has been modified ; update modules to take it into account, see ticket:196

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 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/namtraldf/ 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 namtraldf : Lateral physics on tracers
80      REWIND( numnam )
81      READ  ( numnam, namtraldf )
82
83      IF(lwp) THEN
84         WRITE(numout,*)
85         WRITE(numout,*) 'ldf_tra_init : lateral tracer physics'
86         WRITE(numout,*) '~~~~~~~~~~~~ '
87         WRITE(numout,*) '          Namelist namtraldf : 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 ) &
115           &   CALL ctl_stop( '          key_traldf_c1d can only be used in z-coordinate - full step' )
116#endif
117      IF( ioptio == 0 ) THEN
118          IF(lwp) WRITE(numout,*) '          tracer mixing coef. = constant (default option)'
119        ELSEIF( ioptio > 1 ) THEN
120           CALL ctl_stop('          use only one of the following keys:',   &
121             &           ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' )
122      ENDIF
123
124      IF( ln_traldf_bilap ) THEN
125         IF(lwp) WRITE(numout,*) '          biharmonic tracer diffusion'
126         IF( aht0 > 0 .AND. .NOT. lk_esopa )   &
127              &   CALL ctl_stop( '          The horizontal diffusivity coef. aht0 must be negative' )
128      ELSE
129         IF(lwp) WRITE(numout,*) '          harmonic tracer diffusion (default)'
130         IF( aht0 < 0 .AND. .NOT. lk_esopa )   &
131              &   CALL ctl_stop('          The horizontal diffusivity coef. aht0 must be positive' )
132      ENDIF
133
134
135      !  Lateral eddy diffusivity and eddy induced velocity coefficients
136      ! ================================================================
137
138#if defined key_traldf_c3d
139      CALL ldf_tra_c3d( ll_print )      ! aht = 3D coef. = F( longitude, latitude, depth )
140#elif defined key_traldf_c2d
141      CALL ldf_tra_c2d( ll_print )      ! aht = 2D coef. = F( longitude, latitude )
142#elif defined key_traldf_c1d
143      CALL ldf_tra_c1d( ll_print )      ! aht = 1D coef. = F( depth )
144#else
145                                        ! Constant coefficients
146      IF(lwp)WRITE(numout,*)
147      IF(lwp)WRITE(numout,*) '          constant eddy diffusivity coef.   ahtu = ahtv = ahtw = aht0 = ', aht0
148      IF( lk_traldf_eiv ) THEN
149         IF(lwp)WRITE(numout,*)
150         IF(lwp)WRITE(numout,*) '          constant eddy induced velocity coef.   aeiu = aeiv = aeiw = aeiv0 = ', aeiv0
151      ENDIF
152#endif
153
154   END SUBROUTINE ldf_tra_init
155
156#if defined key_traldf_c3d
157#   include "ldftra_c3d.h90"
158#elif defined key_traldf_c2d
159#   include "ldftra_c2d.h90"
160#elif defined key_traldf_c1d
161#   include "ldftra_c1d.h90"
162#endif
163
164   !!======================================================================
165END MODULE ldftra
Note: See TracBrowser for help on using the repository browser.