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.
zdfini.F90 in branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/ZDF – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90 @ 2281

Last change on this file since 2281 was 2281, checked in by smasson, 13 years ago

set proper svn properties to all files...

  • Property svn:keywords set to Id
File size: 8.8 KB
Line 
1MODULE zdfini
2   !!======================================================================
3   !!                      ***  MODULE  zdfini  ***
4   !! Ocean physics :   read vertical mixing namelist and check consistancy
5   !!======================================================================
6   !! History :  8.0  ! 1997-06  (G. Madec)  Original code from inimix
7   !!            1.0  ! 2002-08  (G. Madec)  F90 : free form
8   !!             -   ! 2005-06  (C. Ethe) KPP parameterization
9   !!             -   ! 2009-07  (G. Madec) add avmb, avtb in restart for cen2 advection
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   zdf_init    : initialization, namelist read, and parameters control
14   !!----------------------------------------------------------------------
15   USE par_oce         ! mesh and scale factors
16   USE ldftra_oce      ! ocean active tracers: lateral physics
17   USE ldfdyn_oce      ! ocean dynamics lateral physics
18   USE zdf_oce         ! TKE vertical mixing         
19   USE lib_mpp         ! distribued memory computing
20   USE zdftke_old      ! TKE vertical mixing  (old scheme)
21   USE zdftke          ! TKE vertical mixing
22   USE zdfgls          ! GLS vertical mixing
23   USE zdfkpp          ! KPP vertical mixing         
24   USE zdfddm          ! double diffusion mixing     
25   USE zdfevd          ! enhanced vertical diffusion 
26   USE zdfric          ! Richardson vertical mixing   
27   USE tranpc          ! convection: non penetrative adjustment
28   USE ldfslp          ! iso-neutral slopes
29   USE restart         ! ocean restart
30
31   USE in_out_manager  ! I/O manager
32   USE iom             ! IOM library
33
34   IMPLICIT NONE
35   PRIVATE
36
37   PUBLIC   zdf_init   ! routine called by opa.F90
38   
39   !!----------------------------------------------------------------------
40   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)
41   !! $Id$
42   !! Software governed by the CeCILL licence  (NEMOGCM/License_CeCILL.txt)
43   !!----------------------------------------------------------------------
44   
45CONTAINS
46
47   SUBROUTINE zdf_init
48      !!----------------------------------------------------------------------
49      !!                  ***  ROUTINE zdf_init  ***
50      !!
51      !! ** Purpose :   initializations of the vertical ocean physics
52      !!
53      !! ** Method  :   Read namelist namzdf, control logicals
54      !!----------------------------------------------------------------------
55      INTEGER ::   ioptio       ! temporary scalar
56      !!
57      NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp,   &
58         &              ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp
59      !!----------------------------------------------------------------------
60
61      REWIND( numnam )           !* Read namzdf namelist : vertical mixing parameters
62      READ  ( numnam, namzdf )
63
64      IF(lwp) THEN               !* Parameter print
65         WRITE(numout,*)
66         WRITE(numout,*) 'zdf_init: vertical physics'
67         WRITE(numout,*) '~~~~~~~~'
68         WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters'
69         WRITE(numout,*) '      vertical eddy viscosity             rn_avm0   = ', rn_avm0
70         WRITE(numout,*) '      vertical eddy diffusivity           rn_avt0   = ', rn_avt0
71         WRITE(numout,*) '      constant background or profile      nn_avb    = ', nn_avb
72         WRITE(numout,*) '      horizontal variation for avtb       nn_havtb  = ', nn_havtb
73         WRITE(numout,*) '      time splitting / backward scheme    ln_zdfexp = ', ln_zdfexp
74         WRITE(numout,*) '      number of time step                 nn_zdfexp = ', nn_zdfexp
75         WRITE(numout,*) '      enhanced vertical diffusion         ln_zdfevd = ', ln_zdfevd
76         WRITE(numout,*) '         applied on momentum (=1/0)       nn_evdm   = ', nn_evdm
77         WRITE(numout,*) '      vertical coefficient for evd        rn_avevd  = ', rn_avevd
78         WRITE(numout,*) '      non-penetrative convection (npc)    ln_zdfnpc = ', ln_zdfnpc
79         WRITE(numout,*) '      npc call  frequency                 nn_npc    = ', nn_npc
80         WRITE(numout,*) '      npc print frequency                 nn_npcp   = ', nn_npcp
81      ENDIF
82
83      !                          !* Parameter & logical controls
84      !                          !  ----------------------------
85      !
86      !                               ! ... check of vertical mixing scheme on tracers
87      !                                              ==> will be done in trazdf module
88      !
89      !                               ! ... check of mixing coefficient
90      IF(lwp) WRITE(numout,*)
91      IF(lwp) WRITE(numout,*) '   vertical mixing option :'
92      ioptio = 0
93      IF( lk_zdfcst ) THEN
94         IF(lwp) WRITE(numout,*) '      constant eddy diffusion coefficients'
95         ioptio = ioptio+1
96      ENDIF
97      IF( lk_zdfric ) THEN
98         IF(lwp) WRITE(numout,*) '      Richardson dependent eddy coefficients'
99         ioptio = ioptio+1
100      ENDIF
101      IF( lk_zdftke_old ) THEN
102         IF(lwp) WRITE(numout,*) '      TKE dependent eddy coefficients'
103         ioptio = ioptio+1
104      ENDIF
105      IF( lk_zdftke ) THEN
106         IF(lwp) WRITE(numout,*) '      TKE dependent eddy coefficients'
107         ioptio = ioptio+1
108      ENDIF
109      IF( lk_zdfgls ) THEN
110         IF(lwp) WRITE(numout,*) '      GLS dependent eddy coefficients'
111         ioptio = ioptio+1
112      ENDIF
113      IF( lk_zdfkpp ) THEN
114         IF(lwp) WRITE(numout,*) '      KPP dependent eddy coefficients'
115         ioptio = ioptio+1
116      ENDIF
117      IF( ioptio == 0 .OR. ioptio > 1 .AND. .NOT. lk_esopa ) &
118         &   CALL ctl_stop( ' one and only one vertical diffusion option has to be defined ' )
119      !
120      !                               ! ... Convection
121      IF(lwp) WRITE(numout,*)
122      IF(lwp) WRITE(numout,*) '   convection :'
123      ioptio = 0
124      IF( ln_zdfnpc ) THEN
125         IF(lwp) WRITE(numout,*) '      use non penetrative convective scheme'
126         ioptio = ioptio+1
127      ENDIF
128      IF( ln_zdfevd ) THEN
129         IF(lwp) WRITE(numout,*) '      use enhanced vertical dif. scheme'
130         ioptio = ioptio+1
131      ENDIF
132      IF( lk_zdftke_old .OR. lk_zdftke ) THEN
133         IF(lwp) WRITE(numout,*) '      use the 1.5 turbulent closure'
134      ENDIF
135      IF( lk_zdfgls ) THEN
136         IF(lwp) WRITE(numout,*) '      use the GLS closure scheme'
137      ENDIF
138      IF( lk_zdfkpp ) THEN
139         IF(lwp) WRITE(numout,*) '      use the KPP closure scheme'
140         IF(lk_mpp) THEN
141            IF(lwp) WRITE(numout,cform_err)
142            IF(lwp) WRITE(numout,*) 'The KPP scheme is not ready to run in MPI'
143         ENDIF
144      ENDIF
145      IF ( ioptio > 1 .AND. .NOT. lk_esopa )   CALL ctl_stop( ' chose between ln_zdfnpc and ln_zdfevd' )
146      IF( ioptio == 0 .AND. .NOT.( lk_zdftke_old .OR. lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp ) ) &
147         CALL ctl_stop( ' except for TKE, GLS or KPP physics, a convection scheme is', &
148         &              ' required: ln_zdfevd or ln_zdfnpc logicals' )
149
150
151      !                               !* Background eddy viscosity and diffusivity profil
152      IF( nn_avb == 0 ) THEN                ! Define avmb, avtb from namelist parameter
153         avmb(:) = rn_avm0
154         avtb(:) = rn_avt0                     
155      ELSE                                  ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990)
156         avmb(:) = rn_avm0
157         avtb(:) = rn_avt0 + ( 3.0e-4 - 2 * rn_avt0 ) * 1.0e-4 * gdepw_0(:)   ! m2/s
158         IF(ln_sco .AND. lwp)   CALL ctl_warn( '          avtb profile not valid in sco' )
159      ENDIF
160      !
161      IF( ln_rstart ) THEN                  !  Read avmb, avtb in restart (if exist)
162         ! if ln_traadv_cen, avmb, avtb have been modified in traadv_cen2 module.
163         ! To ensure the restartability, avmb & avtb are written in the restart
164         ! file in traadv_cen2 end read here.
165         IF( iom_varid( numror, 'avmb', ldstop = .FALSE. ) > 0 ) THEN
166            CALL iom_get( numror, jpdom_unknown, 'avmb', avmb )
167            CALL iom_get( numror, jpdom_unknown, 'avtb', avtb )
168         ENDIF
169      ENDIF
170      !                                     ! 2D shape of the avtb
171      avtb_2d(:,:) = 1.e0                        ! uniform
172      !
173      IF( nn_havtb == 1 ) THEN                   ! decrease avtb in the equatorial band
174           !  -15S -5S : linear decrease from avt0 to avt0/10.
175           !  -5S  +5N : cst value avt0/10.
176           !   5N  15N : linear increase from avt0/10, to avt0
177           WHERE(-15. <= gphit .AND. gphit < -5 )   avtb_2d = (1.  - 0.09 * (gphit + 15.))
178           WHERE( -5. <= gphit .AND. gphit <  5 )   avtb_2d =  0.1
179           WHERE(  5. <= gphit .AND. gphit < 15 )   avtb_2d = (0.1 + 0.09 * (gphit -  5.))
180      ENDIF
181      !
182   END SUBROUTINE zdf_init
183
184   !!======================================================================
185END MODULE zdfini
Note: See TracBrowser for help on using the repository browser.