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

source: trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90 @ 9294

Last change on this file since 9294 was 7646, checked in by timgraham, 7 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

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