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/2012/dev_r3452_NOCL02_Smagorinsky/NEMOGCM/NEMO/OPA_SRC/LDF – NEMO

source: branches/2012/dev_r3452_NOCL02_Smagorinsky/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90 @ 3497

Last change on this file since 3497 was 3497, checked in by hliu, 11 years ago

Upload code files for Smagorinsky viscosity/diffusivity work, documentation to be converted to latex format and uploaded soon. See the ticket (coming in minutes)

  • Property svn:keywords set to Id
File size: 8.7 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   !! * Substitutions
33#  include "domzgr_substitute.h90"
34#  include "vectopt_loop_substitute.h90"
35   !!----------------------------------------------------------------------
36   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
37   !! $Id$
38   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
39   !!----------------------------------------------------------------------
40CONTAINS
41
42   SUBROUTINE ldf_tra_init
43      !!----------------------------------------------------------------------
44      !!                  ***  ROUTINE ldf_tra_init  ***
45      !!
46      !! ** Purpose :   initializations of the tracer lateral mixing coeff.
47      !!
48      !! ** Method  :   the Eddy diffusivity and eddy induced velocity ceoff.
49      !!      are defined as follows:
50      !!         default option   : constant coef. aht0, aeiv0 (namelist)
51      !!        'key_traldf_c1d': depth dependent coef. defined in
52      !!                            in ldf_tra_c1d routine
53      !!        'key_traldf_c2d': latitude and longitude dependent coef.
54      !!                            defined in ldf_tra_c2d routine
55      !!        'key_traldf_c3d': latitude, longitude, depth dependent coef.
56      !!                            defined in ldf_tra_c3d routine
57      !!
58      !!      N.B. User defined include files.  By default, 3d and 2d coef.
59      !!      are set to a constant value given in the namelist and the 1d
60      !!      coefficients are initialized to a hyperbolic tangent vertical
61      !!      profile.
62      !!----------------------------------------------------------------------
63      INTEGER ::   ioptio               ! temporary integer
64      LOGICAL ::   ll_print = .FALSE.   ! =T print eddy coef. in numout
65      !!
66      NAMELIST/namtra_ldf/ ln_traldf_lap  , ln_traldf_bilap,                  &
67         &                 ln_traldf_level, ln_traldf_hor  , ln_traldf_iso,   &
68         &                 ln_traldf_grif , ln_traldf_gdia ,                  &
69         &                 ln_triad_iso   , ln_botmix_grif ,                  &
70         &                 rn_aht_0       , rn_ahtb_0      , rn_aeiv_0,       &
71         &                 rn_slpmax      , rn_chsmag      ,    rn_smsh,      &
72         &                 rn_aht_m
73      !!----------------------------------------------------------------------
74
75      !  Define the lateral tracer physics parameters
76      ! =============================================
77   
78      REWIND( numnam )                  ! Read Namelist namtra_ldf : Lateral physics on tracers
79      READ  ( numnam, namtra_ldf )
80
81      IF(lwp) THEN                      ! control print
82         WRITE(numout,*)
83         WRITE(numout,*) 'ldf_tra_init : lateral tracer physics'
84         WRITE(numout,*) '~~~~~~~~~~~~ '
85         WRITE(numout,*) '   Namelist namtra_ldf : lateral mixing parameters (type, direction, coefficients)'
86         WRITE(numout,*) '      laplacian operator            ln_traldf_lap   = ', ln_traldf_lap
87         WRITE(numout,*) '      bilaplacian operator          ln_traldf_bilap = ', ln_traldf_bilap
88         WRITE(numout,*) '      iso-level                     ln_traldf_level = ', ln_traldf_level
89         WRITE(numout,*) '      horizontal (geopotential)     ln_traldf_hor   = ', ln_traldf_hor
90         WRITE(numout,*) '      iso-neutral                   ln_traldf_iso   = ', ln_traldf_iso
91         WRITE(numout,*) '      iso-neutral (Griffies)        ln_traldf_grif  = ', ln_traldf_grif
92         WRITE(numout,*) '      Griffies strmfn diagnostics   ln_traldf_gdia  = ', ln_traldf_gdia
93         WRITE(numout,*) '      lateral eddy diffusivity      rn_aht_0        = ', rn_aht_0
94         WRITE(numout,*) '      background hor. diffusivity   rn_ahtb_0       = ', rn_ahtb_0
95         WRITE(numout,*) '      eddy induced velocity coef.   rn_aeiv_0       = ', rn_aeiv_0
96         WRITE(numout,*) '      maximum isoppycnal slope      rn_slpmax       = ', rn_slpmax
97         WRITE(numout,*) '      pure lateral mixing in ML     ln_triad_iso    = ', ln_triad_iso
98         WRITE(numout,*) '      lateral mixing on bottom      ln_botmix_grif  = ', ln_botmix_grif
99         WRITE(numout,*)
100      ENDIF
101
102      !                                ! convert DOCTOR namelist names into OLD names
103      aht0  = rn_aht_0
104      ahtb0 = rn_ahtb_0
105      aeiv0 = rn_aeiv_0
106
107      !                                ! Parameter control
108
109      ! ... Check consistency for type and direction :
110      !           ==> will be done in traldf module
111
112      ! ... Space variation of eddy coefficients
113      ioptio = 0
114#if defined key_traldf_c3d
115      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude, depth)'
116      ioptio = ioptio + 1
117#endif
118#if defined key_traldf_c2d
119      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( latitude, longitude)'
120      ioptio = ioptio + 1
121#endif
122#if defined key_traldf_c1d
123      IF(lwp) WRITE(numout,*) '          tracer mixing coef. = F( depth )'
124      ioptio = ioptio + 1
125      IF( .NOT. ln_zco )   CALL ctl_stop( 'key_traldf_c1d can only be used in z-coordinate - full step' )
126#endif
127      IF( ioptio == 0 ) THEN
128          IF(lwp) WRITE(numout,*) '          tracer mixing coef. = constant (default option)'
129        ELSEIF( ioptio > 1 ) THEN
130           CALL ctl_stop('          use only one of the following keys:',   &
131             &           ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' )
132      ENDIF
133
134      IF( ln_traldf_bilap ) THEN
135         IF(lwp) WRITE(numout,*) '          biharmonic tracer diffusion'
136         IF( aht0 > 0 .AND. .NOT. lk_esopa )   CALL ctl_stop( 'The horizontal diffusivity coef. aht0 must be negative' )
137      ELSE
138         IF(lwp) WRITE(numout,*) '          harmonic tracer diffusion (default)'
139         IF( aht0 < 0 .AND. .NOT. lk_esopa )   CALL ctl_stop('The horizontal diffusivity coef. aht0 must be positive' )
140      ENDIF
141
142
143      !  Lateral eddy diffusivity and eddy induced velocity coefficients
144      ! ================================================================
145#if defined key_traldf_c3d
146      CALL ldf_tra_c3d( ll_print )      ! aht = 3D coef. = F( longitude, latitude, depth )
147#elif defined key_traldf_c2d
148      CALL ldf_tra_c2d( ll_print )      ! aht = 2D coef. = F( longitude, latitude )
149#elif defined key_traldf_c1d
150      CALL ldf_tra_c1d( ll_print )      ! aht = 1D coef. = F( depth )
151#else
152                                        ! Constant coefficients
153      IF(lwp)WRITE(numout,*)
154      IF(lwp)WRITE(numout,*) '      constant eddy diffusivity coef.   ahtu = ahtv = ahtw = aht0 = ', aht0
155      IF( lk_traldf_eiv ) THEN
156         IF(lwp)WRITE(numout,*) '      constant eddy induced velocity coef.   aeiu = aeiv = aeiw = aeiv0 = ', aeiv0
157     
158      ENDIF
159#endif
160
161#if defined key_traldf_smag && ! defined key_traldf_c3d
162        CALL ctl_stop( 'key_traldf_smag can only be used with key_traldf_c3d' )
163#endif
164#if defined key_traldf_smag
165        IF(lwp) WRITE(numout,*)' SMAGORINSKY DIFFUSION'
166        IF(lwp .AND. rn_smsh < 1)  WRITE(numout,*)' only  shear is used '
167        IF(lwp.and.ln_traldf_bilap) CALL ctl_stop(' SMAGORINSKY + BILAPLACIAN - UNSTABLE OR NON_CONSERVATIVE' )
168#endif
169
170      !
171   END SUBROUTINE ldf_tra_init
172
173#if defined key_traldf_c3d
174#   include "ldftra_c3d.h90"
175#elif defined key_traldf_c2d
176#   include "ldftra_c2d.h90"
177#elif defined key_traldf_c1d
178#   include "ldftra_c1d.h90"
179#endif
180
181   !!======================================================================
182END MODULE ldftra
Note: See TracBrowser for help on using the repository browser.