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/2016/dev_merge_2016/NEMOGCM/CONFIG/LOCK_EXCHANGE/MY_SRC – NEMO

source: branches/2016/dev_merge_2016/NEMOGCM/CONFIG/LOCK_EXCHANGE/MY_SRC/zdfini.F90 @ 7624

Last change on this file since 7624 was 7624, checked in by flavoni, 7 years ago

update test lock and overflow with dev_merge_2016

File size: 9.0 KB
Line 
1MODULE zdfini
2   !!======================================================================
3   !!                     ***  MODULE zdfini  ***
4   !!
5   !!                     ===  LOCK_EXCHANGE case  ===
6   !!
7   !! Ocean physics :   read vertical mixing namelist and check consistancy
8   !!======================================================================
9   !! History :  8.0  ! 1997-06  (G. Madec)  Original code from inimix
10   !!            1.0  ! 2002-08  (G. Madec)  F90 : free form
11   !!             -   ! 2005-06  (C. Ethe) KPP scheme
12   !!             -   ! 2009-07  (G. Madec) add avmb, avtb in restart for cen2 advection
13   !!            3.7  ! 2014-12  (G. Madec) remove KPP scheme
14   !!----------------------------------------------------------------------
15
16   !!----------------------------------------------------------------------
17   !!   zdf_init    : initialization, namelist read, and parameters control
18   !!----------------------------------------------------------------------
19   USE par_oce         ! mesh and scale factors
20   USE zdf_oce         ! TKE vertical mixing         
21   USE sbc_oce         ! surface module (only for nn_isf in the option compatibility test)
22   USE zdftke          ! TKE vertical mixing
23   USE zdfgls          ! GLS vertical mixing
24   USE zdfric          ! Richardson vertical mixing   
25   USE zdfddm          ! double diffusion mixing     
26   USE zdfevd          ! enhanced vertical diffusion 
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   USE lib_mpp         ! distribued memory computing
33
34   IMPLICIT NONE
35   PRIVATE
36
37   PUBLIC   zdf_init   ! routine called by opa.F90
38   
39   !!----------------------------------------------------------------------
40   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
41   !! $Id$
42   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
43   !!----------------------------------------------------------------------
44CONTAINS
45
46   SUBROUTINE zdf_init
47      !!----------------------------------------------------------------------
48      !!                  ***  ROUTINE zdf_init  ***
49      !!
50      !! ** Purpose :   initializations of the vertical ocean physics
51      !!
52      !! ** Method  :   Read namelist namzdf, control logicals
53      !!----------------------------------------------------------------------
54      INTEGER ::   ioptio, ios       ! local integers
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         &              ln_zdfqiao
59      !!----------------------------------------------------------------------
60
61      REWIND( numnam_ref )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
62      READ  ( numnam_ref, namzdf, IOSTAT = ios, ERR = 901)
63901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in reference namelist', lwp )
64
65      REWIND( numnam_cfg )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
66      READ  ( numnam_cfg, namzdf, IOSTAT = ios, ERR = 902 )
67902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in configuration namelist', lwp )
68      IF(lwm) WRITE ( numond, namzdf )
69
70      IF(lwp) THEN               !* Parameter print
71         WRITE(numout,*)
72         WRITE(numout,*) 'zdf_init: vertical physics'
73         WRITE(numout,*) '~~~~~~~~'
74         WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters'
75         WRITE(numout,*) '      vertical eddy viscosity             rn_avm0   = ', rn_avm0
76         WRITE(numout,*) '      vertical eddy diffusivity           rn_avt0   = ', rn_avt0
77         WRITE(numout,*) '      constant background or profile      nn_avb    = ', nn_avb
78         WRITE(numout,*) '      horizontal variation for avtb       nn_havtb  = ', nn_havtb
79         WRITE(numout,*) '      time splitting / backward scheme    ln_zdfexp = ', ln_zdfexp
80         WRITE(numout,*) '      number of time step                 nn_zdfexp = ', nn_zdfexp
81         WRITE(numout,*) '      enhanced vertical diffusion         ln_zdfevd = ', ln_zdfevd
82         WRITE(numout,*) '         applied on momentum (=1/0)       nn_evdm   = ', nn_evdm
83         WRITE(numout,*) '      vertical coefficient for evd        rn_avevd  = ', rn_avevd
84         WRITE(numout,*) '      non-penetrative convection (npc)    ln_zdfnpc = ', ln_zdfnpc
85         WRITE(numout,*) '      npc call  frequency                 nn_npc    = ', nn_npc
86         WRITE(numout,*) '      npc print frequency                 nn_npcp   = ', nn_npcp
87      ENDIF
88
89      !                          !* Parameter & logical controls
90      !                          !  ----------------------------
91      !
92      !                               ! ... check of vertical mixing scheme on tracers
93      !                                              ==> will be done in trazdf module
94      !
95      !                               ! ... check of mixing coefficient
96      IF(lwp) WRITE(numout,*)
97      IF(lwp) WRITE(numout,*) '   vertical mixing option :'
98      ioptio = 0
99      IF( lk_zdfcst ) THEN
100         IF(lwp) WRITE(numout,*) '      constant eddy diffusion coefficients'
101         ioptio = ioptio+1
102      ENDIF
103      IF( lk_zdfric ) THEN
104         IF(lwp) WRITE(numout,*) '      Richardson dependent eddy coefficients'
105         ioptio = ioptio+1
106      ENDIF
107      IF( lk_zdftke ) THEN
108         IF(lwp) WRITE(numout,*) '      TKE dependent eddy coefficients'
109         ioptio = ioptio+1
110      ENDIF
111      IF( lk_zdfgls ) THEN
112         IF(lwp) WRITE(numout,*) '      GLS dependent eddy coefficients'
113         ioptio = ioptio+1
114      ENDIF
115      IF( ioptio == 0 .OR. ioptio > 1 )   &
116         &   CALL ctl_stop( ' one and only one vertical diffusion option has to be defined ' )
117      IF( ( lk_zdfric .OR. lk_zdfgls ) .AND. ln_isfcav )   &
118         &   CALL ctl_stop( ' only zdfcst and zdftke were tested with ice shelves cavities ' )
119      !
120      !                               ! ... Convection
121      IF(lwp) WRITE(numout,*)
122      IF(lwp) WRITE(numout,*) '   convection :'
123      !
124#if defined key_top
125      IF( ln_zdfnpc )   CALL ctl_stop( ' zdf_init: npc scheme is not working with key_top' )
126#endif
127      !
128      ioptio = 0
129      IF( ln_zdfnpc ) THEN
130         IF(lwp) WRITE(numout,*) '      use non penetrative convective scheme'
131         ioptio = ioptio+1
132      ENDIF
133      IF( ln_zdfevd ) THEN
134         IF(lwp) WRITE(numout,*) '      use enhanced vertical dif. scheme'
135         ioptio = ioptio+1
136      ENDIF
137      IF( lk_zdftke ) THEN
138         IF(lwp) WRITE(numout,*) '      use the 1.5 turbulent closure'
139      ENDIF
140      IF( lk_zdfgls ) THEN
141         IF(lwp) WRITE(numout,*) '      use the GLS closure scheme'
142      ENDIF
143      IF ( ioptio > 1 )   CALL ctl_stop( ' chose between ln_zdfnpc and ln_zdfevd' )
144      IF( ioptio == 0 .AND. .NOT.( lk_zdftke .OR. lk_zdfgls ) )           &
145         !SF CALL ctl_stop( ' except for TKE or GLS physics, a convection scheme is',   &
146         CALL ctl_warn( ' except for TKE or GLS physics, a convection scheme is',   &
147         &              ' required: ln_zdfevd or ln_zdfnpc logicals' )
148
149      !                               !* Background eddy viscosity and diffusivity profil
150      IF( nn_avb == 0 ) THEN                ! Define avmb, avtb from namelist parameter
151         avmb(:) = rn_avm0
152         avtb(:) = rn_avt0                     
153      ELSE                                  ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990)
154         avmb(:) = rn_avm0
155         avtb(:) = rn_avt0 + ( 3.e-4_wp - 2._wp * rn_avt0 ) * 1.e-4_wp * gdepw_1d(:)   ! m2/s
156         IF(ln_sco .AND. lwp)   CALL ctl_warn( 'avtb profile not valid in sco' )
157      ENDIF
158      !
159      IF( ln_rstart ) THEN                  !  Read avmb, avtb in restart (if exist)
160         ! if ln_traadv_cen, avmb, avtb have been modified in traadv_cen2 module.
161         ! To ensure the restartability, avmb & avtb are written in the restart
162         ! file in traadv_cen2 end read here.
163         IF( iom_varid( numror, 'avmb', ldstop = .FALSE. ) > 0 ) THEN
164            CALL iom_get( numror, jpdom_unknown, 'avmb', avmb )
165            CALL iom_get( numror, jpdom_unknown, 'avtb', avtb )
166         ENDIF
167      ENDIF
168      !                                     ! 2D shape of the avtb
169      avtb_2d(:,:) = 1.e0                        ! uniform
170      !
171      IF( nn_havtb == 1 ) THEN                   ! decrease avtb in the equatorial band
172           !  -15S -5S : linear decrease from avt0 to avt0/10.
173           !  -5S  +5N : cst value avt0/10.
174           !   5N  15N : linear increase from avt0/10, to avt0
175           WHERE(-15. <= gphit .AND. gphit < -5 )   avtb_2d = (1.  - 0.09 * (gphit + 15.))
176           WHERE( -5. <= gphit .AND. gphit <  5 )   avtb_2d =  0.1
177           WHERE(  5. <= gphit .AND. gphit < 15 )   avtb_2d = (0.1 + 0.09 * (gphit -  5.))
178      ENDIF
179      !
180   END SUBROUTINE zdf_init
181
182   !!======================================================================
183END MODULE zdfini
Note: See TracBrowser for help on using the repository browser.