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 branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF – NEMO

source: branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90 @ 4401

Last change on this file since 4401 was 3211, checked in by spickles2, 13 years ago

Stephen Pickles, 11 Dec 2011

Commit to bring the rest of the DCSE NEMO development branch
in line with the latest development version. This includes
array index re-ordering of all OPA_SRC/.

  • Property svn:keywords set to Id
File size: 8.5 KB
Line 
1MODULE ldftra
2   !!======================================================================
3   !!                       ***  MODULE  ldftra  ***
4   !! Ocean physics:  lateral diffusivity coefficient
5   !!=====================================================================
6   !! History :        ! 1997-07  (G. Madec)  from inimix.F split in 2 routines
7   !!   NEMO      1.0  ! 2002-09  (G. Madec)  F90: Free form and module
8   !!             2.0  ! 2005-11  (G. Madec) 
9   !!----------------------------------------------------------------------
10
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   USE oce             ! ocean dynamics and tracers
18   USE dom_oce         ! ocean space and time domain
19   USE phycst          ! physical constants
20   USE ldftra_oce      ! ocean tracer   lateral physics
21   USE ldfslp          ! ???
22   USE in_out_manager  ! I/O manager
23   USE ioipsl
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   PUBLIC   ldf_tra_init   ! called by opa.F90
31
32   !! * Control permutation of array indices
33#  include "oce_ftrans.h90"
34#  include "dom_oce_ftrans.h90"
35#  include "ldftra_oce_ftrans.h90"
36#  include "ldfslp_ftrans.h90"
37
38   !! * Substitutions
39#  include "domzgr_substitute.h90"
40#  include "vectopt_loop_substitute.h90"
41   !!----------------------------------------------------------------------
42   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
43   !! $Id$
44   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
45   !!----------------------------------------------------------------------
46CONTAINS
47
48   SUBROUTINE ldf_tra_init
49      !!----------------------------------------------------------------------
50      !!                  ***  ROUTINE ldf_tra_init  ***
51      !!
52      !! ** Purpose :   initializations of the tracer lateral mixing coeff.
53      !!
54      !! ** Method  :   the Eddy diffusivity and eddy induced velocity ceoff.
55      !!      are defined as follows:
56      !!         default option   : constant coef. aht0, aeiv0 (namelist)
57      !!        'key_traldf_c1d': depth dependent coef. defined in
58      !!                            in ldf_tra_c1d routine
59      !!        'key_traldf_c2d': latitude and longitude dependent coef.
60      !!                            defined in ldf_tra_c2d routine
61      !!        'key_traldf_c3d': latitude, longitude, depth dependent coef.
62      !!                            defined in ldf_tra_c3d routine
63      !!
64      !!      N.B. User defined include files.  By default, 3d and 2d coef.
65      !!      are set to a constant value given in the namelist and the 1d
66      !!      coefficients are initialized to a hyperbolic tangent vertical
67      !!      profile.
68      !!----------------------------------------------------------------------
69      INTEGER ::   ioptio               ! temporary integer
70      LOGICAL ::   ll_print = .FALSE.   ! =T print eddy coef. in numout
71      !!
72      NAMELIST/namtra_ldf/ ln_traldf_lap  , ln_traldf_bilap,                  &
73         &                 ln_traldf_level, ln_traldf_hor  , ln_traldf_iso,   &
74         &                 ln_traldf_grif , ln_traldf_gdia,                   &
75         &                 rn_aht_0       , rn_ahtb_0      , rn_aeiv_0,       &
76         &                 rn_slpmax
77      !!----------------------------------------------------------------------
78
79      !  Define the lateral tracer physics parameters
80      ! =============================================
81   
82      REWIND( numnam )                  ! Read Namelist namtra_ldf : Lateral physics on tracers
83      READ  ( numnam, namtra_ldf )
84
85      IF(lwp) THEN                      ! control print
86         WRITE(numout,*)
87         WRITE(numout,*) 'ldf_tra_init : lateral tracer physics'
88         WRITE(numout,*) '~~~~~~~~~~~~ '
89         WRITE(numout,*) '   Namelist namtra_ldf : lateral mixing parameters (type, direction, coefficients)'
90         WRITE(numout,*) '      laplacian operator            ln_traldf_lap   = ', ln_traldf_lap
91         WRITE(numout,*) '      bilaplacian operator          ln_traldf_bilap = ', ln_traldf_bilap
92         WRITE(numout,*) '      iso-level                     ln_traldf_level = ', ln_traldf_level
93         WRITE(numout,*) '      horizontal (geopotential)     ln_traldf_hor   = ', ln_traldf_hor
94         WRITE(numout,*) '      iso-neutral                   ln_traldf_iso   = ', ln_traldf_iso
95         WRITE(numout,*) '      iso-neutral (Griffies)        ln_traldf_grif  = ', ln_traldf_grif
96         WRITE(numout,*) '      Griffies strmfn diagnostics   ln_traldf_gdia  = ', ln_traldf_gdia
97         WRITE(numout,*) '      lateral eddy diffusivity      rn_aht_0        = ', rn_aht_0
98         WRITE(numout,*) '      background hor. diffusivity   rn_ahtb_0       = ', rn_ahtb_0
99         WRITE(numout,*) '      eddy induced velocity coef.   rn_aeiv_0       = ', rn_aeiv_0
100         WRITE(numout,*) '      maximum isoppycnal slope      rn_slpmax       = ', rn_slpmax
101         WRITE(numout,*) '   + griffies operator internal controls not set via the namelist (experimental): '
102         WRITE(numout,*) '      calculate triads twice        l_triad_iso     = ', l_triad_iso
103         WRITE(numout,*) '      no Shapiro filter             l_no_smooth     = ', l_no_smooth
104         WRITE(numout,*)
105      ENDIF
106
107      !                                ! convert DOCTOR namelist names into OLD names
108      aht0  = rn_aht_0
109      ahtb0 = rn_ahtb_0
110      aeiv0 = rn_aeiv_0
111
112      !                                ! Parameter control
113
114      ! ... Check consistency for type and direction :
115      !           ==> will be done in traldf module
116
117      ! ... Space variation of eddy coefficients
118      ioptio = 0
119#if defined key_traldf_c3d
120      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude, depth)'
121      ioptio = ioptio + 1
122#endif
123#if defined key_traldf_c2d
124      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude)'
125      ioptio = ioptio + 1
126#endif
127#if defined key_traldf_c1d
128      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( depth )'
129      ioptio = ioptio + 1
130      IF( .NOT. ln_zco )   CALL ctl_stop( 'key_traldf_c1d can only be used in z-coordinate - full step' )
131#endif
132      IF( ioptio == 0 ) THEN
133          IF(lwp) WRITE(numout,*) '          tracer mixing coef. = constant (default option)'
134        ELSEIF( ioptio > 1 ) THEN
135           CALL ctl_stop('          use only one of the following keys:',   &
136             &           ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' )
137      ENDIF
138
139      IF( ln_traldf_bilap ) THEN
140         IF(lwp) WRITE(numout,*) '          biharmonic tracer diffusion'
141         IF( aht0 > 0 .AND. .NOT. lk_esopa )   CALL ctl_stop( 'The horizontal diffusivity coef. aht0 must be negative' )
142      ELSE
143         IF(lwp) WRITE(numout,*) '          harmonic tracer diffusion (default)'
144         IF( aht0 < 0 .AND. .NOT. lk_esopa )   CALL ctl_stop('The horizontal diffusivity coef. aht0 must be positive' )
145      ENDIF
146
147
148      !  Lateral eddy diffusivity and eddy induced velocity coefficients
149      ! ================================================================
150#if defined key_traldf_c3d
151      CALL ldf_tra_c3d( ll_print )      ! aht = 3D coef. = F( longitude, latitude, depth )
152#elif defined key_traldf_c2d
153      CALL ldf_tra_c2d( ll_print )      ! aht = 2D coef. = F( longitude, latitude )
154#elif defined key_traldf_c1d
155      CALL ldf_tra_c1d( ll_print )      ! aht = 1D coef. = F( depth )
156#else
157                                        ! Constant coefficients
158      IF(lwp)WRITE(numout,*)
159      IF(lwp)WRITE(numout,*) '      constant eddy diffusivity coef.   ahtu = ahtv = ahtw = aht0 = ', aht0
160      IF( lk_traldf_eiv ) THEN
161         IF(lwp)WRITE(numout,*)
162         IF(lwp)WRITE(numout,*) '      constant eddy induced velocity coef.   aeiu = aeiv = aeiw = aeiv0 = ', aeiv0
163      ENDIF
164#endif
165      !
166   END SUBROUTINE ldf_tra_init
167
168#if defined key_traldf_c3d
169#   include "ldftra_c3d.h90"
170#elif defined key_traldf_c2d
171#   include "ldftra_c2d.h90"
172#elif defined key_traldf_c1d
173#   include "ldftra_c1d.h90"
174#endif
175
176   !!======================================================================
177END MODULE ldftra
Note: See TracBrowser for help on using the repository browser.