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.
Changeset 1537 for trunk/NEMO/OPA_SRC/ZDF/zdfini.F90 – NEMO

Ignore:
Timestamp:
2009-07-24T16:22:23+02:00 (15 years ago)
Author:
ctlod
Message:

ensure the restartability of the 2nd order advection scheme,see ticket: 489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/ZDF/zdfini.F90

    r1533 r1537  
    2222   USE tranpc          ! convection: non penetrative adjustment 
    2323   USE ldfslp          ! iso-neutral slopes 
     24   USE restart         ! ocean restart 
    2425 
    2526   USE in_out_manager  ! I/O manager 
     27   USE iom             ! IOM library 
    2628 
    2729   IMPLICIT NONE 
     
    5153      !!   9.0  !  05-06  (C. Ethe) KPP parameterization 
    5254      !!---------------------------------------------------------------------- 
    53       !! * Local declarations 
    5455      INTEGER ::   ioptio       ! temporary scalar 
    55  
    56       !! * Namelist 
    57       NAMELIST/namzdf/ ln_zdfexp, n_zdfexp, ln_zdfevd, ln_zdfnpc,   & 
    58          &             avm0     , avt0    , avevd    , n_evdm 
    59       !!---------------------------------------------------------------------- 
    60       !!  OPA 9.0, LODYC-IPSL (2003) 
    61       !!  
     56      !! 
     57      NAMELIST/nam_zdf/ 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 
    6259      !!---------------------------------------------------------------------- 
    6360 
    64       ! Read namzdf namelist : vertical mixing parameters 
    65       ! -------------------- 
    66       REWIND( numnam ) 
    67       READ  ( numnam, namzdf ) 
     61      REWIND( numnam )               ! Read nam_zdf namelist : vertical mixing parameters 
     62      READ  ( numnam, nam_zdf ) 
    6863 
    69       ! Parameter print 
    70       ! --------------- 
    71       IF(lwp) THEN 
     64      IF(lwp) THEN                   ! Parameter print 
    7265         WRITE(numout,*) 
    7366         WRITE(numout,*) 'zdf_init: vertical physics' 
    7467         WRITE(numout,*) '~~~~~~~~' 
    75          WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters' 
     68         WRITE(numout,*) '   Namelist nam_zdf : 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 
    7673         WRITE(numout,*) '      time splitting / backward scheme    ln_zdfexp = ', ln_zdfexp 
    77          WRITE(numout,*) '      number of time step                  n_zdfexp = ', n_zdfexp 
     74         WRITE(numout,*) '      number of time step                 nn_zdfexp = ', nn_zdfexp 
    7875         WRITE(numout,*) '      enhanced vertical diffusion         ln_zdfevd = ', ln_zdfevd 
    79          WRITE(numout,*) '      non-penetrative convection          ln_zdfnpc = ', ln_zdfnpc 
    80          WRITE(numout,*) '      vertical eddy viscosity             avm0      = ', avm0 
    81          WRITE(numout,*) '      vertical eddy diffusivity           avt0      = ', avt0 
    82          WRITE(numout,*) '      vertical coefficient for evd        avevd     = ', avevd 
    83          WRITE(numout,*) '         applied on momentum (=1/0)       n_evdm    = ', n_evdm 
     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 
    8481      ENDIF 
    8582 
     
    144141         &              ' required: ln_zdfevd or ln_zdfnpc logicals' ) 
    145142 
     143 
     144      !                               !* Background eddy viscosity and diffusivity profil 
     145      IF( nn_avb == 0 ) THEN                ! Define avmb, avtb from namelist parameter 
     146         avmb(:) = rn_avm0 
     147         avtb(:) = rn_avt0                      
     148      ELSE                                  ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990) 
     149         avmb(:) = rn_avm0 
     150         avtb(:) = rn_avt0 + ( 3.0e-4 - 2 * rn_avt0 ) * 1.0e-4 * gdepw_0(:)   ! m2/s 
     151         IF(ln_sco .AND. lwp)   CALL ctl_warn( '          avtb profile not valid in sco' ) 
     152      ENDIF 
     153      ! 
     154      IF( ln_rstart ) THEN                  !  Read avmb, avtb in restart (if exist) 
     155         ! if ln_traadv_cen, avmb, avtb have been modified in traadv_cen2 module.  
     156         ! To ensure the restartability, avmb & avtb are written in the restart  
     157         ! file in traadv_cen2 end read here.  
     158         IF( iom_varid( numror, 'avmb', ldstop = .FALSE. ) > 0 ) THEN 
     159            CALL iom_get( numror, jpdom_unknown, 'avmb', avmb ) 
     160            CALL iom_get( numror, jpdom_unknown, 'avtb', avtb ) 
     161         ENDIF 
     162      ENDIF 
     163      !                                     ! 2D shape of the avtb 
     164      avtb_2d(:,:) = 1.e0                        ! uniform  
     165      ! 
     166      IF( nn_havtb == 1 ) THEN                   ! decrease avtb in the equatorial band 
     167           !  -15S -5S : linear decrease from avt0 to avt0/10. 
     168           !  -5S  +5N : cst value avt0/10. 
     169           !   5N  15N : linear increase from avt0/10, to avt0 
     170           WHERE(-15. <= gphit .AND. gphit < -5 )   avtb_2d = (1.  - 0.09 * (gphit + 15.)) 
     171           WHERE( -5. <= gphit .AND. gphit <  5 )   avtb_2d =  0.1 
     172           WHERE(  5. <= gphit .AND. gphit < 15 )   avtb_2d = (0.1 + 0.09 * (gphit -  5.)) 
     173      ENDIF 
     174      ! 
    146175   END SUBROUTINE zdf_init 
    147176 
Note: See TracChangeset for help on using the changeset viewer.