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/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/NEMO/OPA_SRC/ZDF – NEMO

source: branches/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90 @ 5232

Last change on this file since 5232 was 5232, checked in by davestorkey, 9 years ago

Svn keywords deactivated using "svn propdel" in
branch 2015/dev_r5021_UKMO1_CICE_coupling.

File size: 9.5 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 sbc_oce         ! surface module (only for nn_isf in the option compatibility test)
17   USE ldftra_oce      ! ocean active tracers: lateral physics
18   USE ldfdyn_oce      ! ocean dynamics lateral physics
19   USE zdf_oce         ! TKE vertical mixing         
20   USE lib_mpp         ! distribued memory computing
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
30   USE in_out_manager  ! I/O manager
31   USE iom             ! IOM library
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   zdf_init   ! routine called by opa.F90
37   
38   !!----------------------------------------------------------------------
39   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
40   !! $Id: zdfini.F90 4990 2014-12-15 16:42:49Z timgraham $
41   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
42   !!----------------------------------------------------------------------
43CONTAINS
44
45   SUBROUTINE zdf_init
46      !!----------------------------------------------------------------------
47      !!                  ***  ROUTINE zdf_init  ***
48      !!
49      !! ** Purpose :   initializations of the vertical ocean physics
50      !!
51      !! ** Method  :   Read namelist namzdf, control logicals
52      !!----------------------------------------------------------------------
53      INTEGER ::   ioptio       ! temporary scalar
54      INTEGER ::   ios
55      !!
56      NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp,   &
57         &              ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp
58      !!----------------------------------------------------------------------
59
60      REWIND( numnam_ref )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
61      READ  ( numnam_ref, namzdf, IOSTAT = ios, ERR = 901)
62901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in reference namelist', lwp )
63
64      REWIND( numnam_cfg )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
65      READ  ( numnam_cfg, namzdf, IOSTAT = ios, ERR = 902 )
66902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in configuration namelist', lwp )
67      IF(lwm) WRITE ( numond, namzdf )
68
69      IF(lwp) THEN               !* Parameter print
70         WRITE(numout,*)
71         WRITE(numout,*) 'zdf_init: vertical physics'
72         WRITE(numout,*) '~~~~~~~~'
73         WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters'
74         WRITE(numout,*) '      vertical eddy viscosity             rn_avm0   = ', rn_avm0
75         WRITE(numout,*) '      vertical eddy diffusivity           rn_avt0   = ', rn_avt0
76         WRITE(numout,*) '      constant background or profile      nn_avb    = ', nn_avb
77         WRITE(numout,*) '      horizontal variation for avtb       nn_havtb  = ', nn_havtb
78         WRITE(numout,*) '      time splitting / backward scheme    ln_zdfexp = ', ln_zdfexp
79         WRITE(numout,*) '      number of time step                 nn_zdfexp = ', nn_zdfexp
80         WRITE(numout,*) '      enhanced vertical diffusion         ln_zdfevd = ', ln_zdfevd
81         WRITE(numout,*) '         applied on momentum (=1/0)       nn_evdm   = ', nn_evdm
82         WRITE(numout,*) '      vertical coefficient for evd        rn_avevd  = ', rn_avevd
83         WRITE(numout,*) '      non-penetrative convection (npc)    ln_zdfnpc = ', ln_zdfnpc
84         WRITE(numout,*) '      npc call  frequency                 nn_npc    = ', nn_npc
85         WRITE(numout,*) '      npc print frequency                 nn_npcp   = ', nn_npcp
86      ENDIF
87
88      !                          !* Parameter & logical controls
89      !                          !  ----------------------------
90      !
91      !                               ! ... check of vertical mixing scheme on tracers
92      !                                              ==> will be done in trazdf module
93      !
94      !                               ! ... check of mixing coefficient
95      IF(lwp) WRITE(numout,*)
96      IF(lwp) WRITE(numout,*) '   vertical mixing option :'
97      ioptio = 0
98      IF( lk_zdfcst ) THEN
99         IF(lwp) WRITE(numout,*) '      constant eddy diffusion coefficients'
100         ioptio = ioptio+1
101      ENDIF
102      IF( lk_zdfric ) THEN
103         IF(lwp) WRITE(numout,*) '      Richardson dependent eddy coefficients'
104         ioptio = ioptio+1
105      ENDIF
106      IF( lk_zdftke ) THEN
107         IF(lwp) WRITE(numout,*) '      TKE dependent eddy coefficients'
108         ioptio = ioptio+1
109      ENDIF
110      IF( lk_zdfgls ) THEN
111         IF(lwp) WRITE(numout,*) '      GLS dependent eddy coefficients'
112         ioptio = ioptio+1
113      ENDIF
114      IF( lk_zdfkpp ) THEN
115         IF(lwp) WRITE(numout,*) '      KPP dependent eddy coefficients'
116         ioptio = ioptio+1
117      ENDIF
118      IF( ioptio == 0 .OR. ioptio > 1 .AND. .NOT. lk_esopa )   &
119         &   CALL ctl_stop( ' one and only one vertical diffusion option has to be defined ' )
120      IF( ( lk_zdfric .OR. lk_zdfgls .OR. lk_zdfkpp ) .AND. nn_isf .NE. 0 )   &
121         &   CALL ctl_stop( ' only zdfcst and zdftke were tested with ice shelves cavities ' )
122      !
123      !                               ! ... Convection
124      IF(lwp) WRITE(numout,*)
125      IF(lwp) WRITE(numout,*) '   convection :'
126      !
127      IF( ln_zdfnpc )   CALL ctl_stop( ' zdf_init: non penetrative convective scheme is not working',   &
128         &                                       ' set ln_zdfnpc to FALSE' )
129      !
130      ioptio = 0
131      IF( ln_zdfnpc ) THEN
132         IF(lwp) WRITE(numout,*) '      use non penetrative convective scheme'
133         ioptio = ioptio+1
134      ENDIF
135      IF( ln_zdfevd ) THEN
136         IF(lwp) WRITE(numout,*) '      use enhanced vertical dif. scheme'
137         ioptio = ioptio+1
138      ENDIF
139      IF( lk_zdftke ) THEN
140         IF(lwp) WRITE(numout,*) '      use the 1.5 turbulent closure'
141      ENDIF
142      IF( lk_zdfgls ) THEN
143         IF(lwp) WRITE(numout,*) '      use the GLS closure scheme'
144      ENDIF
145      IF( lk_zdfkpp ) THEN
146         IF(lwp) WRITE(numout,*) '      use the KPP closure scheme'
147         IF(lk_mpp) THEN
148            IF(lwp) WRITE(numout,cform_err)
149            IF(lwp) WRITE(numout,*) 'The KPP scheme is not ready to run in MPI'
150         ENDIF
151      ENDIF
152      IF ( ioptio > 1 .AND. .NOT. lk_esopa )   CALL ctl_stop( ' chose between ln_zdfnpc and ln_zdfevd' )
153      IF( ioptio == 0 .AND. .NOT.( lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp ) )           &
154         CALL ctl_stop( ' except for TKE, GLS or KPP physics, a convection scheme is',   &
155         &              ' required: ln_zdfevd or ln_zdfnpc logicals' )
156
157      !                               !* Background eddy viscosity and diffusivity profil
158      IF( nn_avb == 0 ) THEN                ! Define avmb, avtb from namelist parameter
159         avmb(:) = rn_avm0
160         avtb(:) = rn_avt0                     
161      ELSE                                  ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990)
162         avmb(:) = rn_avm0
163         avtb(:) = rn_avt0 + ( 3.e-4_wp - 2._wp * rn_avt0 ) * 1.e-4_wp * gdepw_1d(:)   ! m2/s
164         IF(ln_sco .AND. lwp)   CALL ctl_warn( 'avtb profile not valid in sco' )
165      ENDIF
166      !
167      IF( ln_rstart ) THEN                  !  Read avmb, avtb in restart (if exist)
168         ! if ln_traadv_cen, avmb, avtb have been modified in traadv_cen2 module.
169         ! To ensure the restartability, avmb & avtb are written in the restart
170         ! file in traadv_cen2 end read here.
171         IF( iom_varid( numror, 'avmb', ldstop = .FALSE. ) > 0 ) THEN
172            CALL iom_get( numror, jpdom_unknown, 'avmb', avmb )
173            CALL iom_get( numror, jpdom_unknown, 'avtb', avtb )
174         ENDIF
175      ENDIF
176      !                                     ! 2D shape of the avtb
177      avtb_2d(:,:) = 1.e0                        ! uniform
178      !
179      IF( nn_havtb == 1 ) THEN                   ! decrease avtb in the equatorial band
180           !  -15S -5S : linear decrease from avt0 to avt0/10.
181           !  -5S  +5N : cst value avt0/10.
182           !   5N  15N : linear increase from avt0/10, to avt0
183           WHERE(-15. <= gphit .AND. gphit < -5 )   avtb_2d = (1.  - 0.09 * (gphit + 15.))
184           WHERE( -5. <= gphit .AND. gphit <  5 )   avtb_2d =  0.1
185           WHERE(  5. <= gphit .AND. gphit < 15 )   avtb_2d = (0.1 + 0.09 * (gphit -  5.))
186      ENDIF
187      !
188   END SUBROUTINE zdf_init
189
190   !!======================================================================
191END MODULE zdfini
Note: See TracBrowser for help on using the repository browser.