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 7953 for branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

Ignore:
Timestamp:
2017-04-23T09:30:41+02:00 (7 years ago)
Author:
gm
Message:

#1880 (HPC-09): add zdfphy (the ZDF manager) + remove all key_...

Location:
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r7646 r7953  
    121121                     DO jj = 2, jpjm1 
    122122                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    123                            IF( avt(ji,jj,jk) <= 5.e-4_wp )  THEN  
     123                           IF( avs(ji,jj,jk) <= 5.e-4_wp )  THEN  
    124124                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    125125                           ENDIF 
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90

    r7931 r7953  
    44   !! Ocean Passive tracers : vertical diffusive trends  
    55   !!===================================================================== 
    6    !! History :  9.0  ! 2005-11 (G. Madec)  Original code 
     6   !! History :  9.0  ! 2005-11  (G. Madec)  Original code 
    77   !!       NEMO 3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA  
     8   !!            4.0  ! 2017-04  (G. Madec)  remove the explicit case 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_top 
     
    1112   !!   'key_top'                                                TOP models 
    1213   !!---------------------------------------------------------------------- 
    13    !!   trc_zdf      : update the tracer trend with the lateral diffusion 
    14    !!   trc_zdf_ini  : initialization, namelist read, and parameters control 
     14   !!   trc_zdf      : update the tracer trend with the vertical diffusion 
    1515   !!---------------------------------------------------------------------- 
    1616   USE trc           ! ocean passive tracers variables 
     
    2727 
    2828   PUBLIC   trc_zdf         ! called by step.F90  
    29    PUBLIC   trc_zdf_ini     ! called by nemogcm.F90  
    3029    
    31    !                                        !!** Vertical diffusion (nam_trczdf) ** 
    32    LOGICAL , PUBLIC ::   ln_trczdf_exp       !: explicit vertical diffusion scheme flag 
    33    INTEGER , PUBLIC ::   nn_trczdf_exp       !: number of sub-time step (explicit time stepping) 
    34  
    35    INTEGER ::   nzdf = 0               ! type vertical diffusion algorithm used 
    36       !                                ! defined from ln_zdf...  namlist logicals) 
    37    !! * Substitutions 
    38 #  include "vectopt_loop_substitute.h90" 
    3930   !!---------------------------------------------------------------------- 
    4031   !! NEMO/TOP 3.7 , NEMO Consortium (2015) 
     
    4839      !!                  ***  ROUTINE trc_zdf  *** 
    4940      !! 
    50       !! ** Purpose :   compute the vertical ocean tracer physics. 
     41      !! ** Purpose :   compute the vertical ocean tracer physics using 
     42      !!              an implicit time-stepping scheme. 
    5143      !!--------------------------------------------------------------------- 
    5244      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index 
     
    5446      INTEGER               ::  jk, jn 
    5547      CHARACTER (len=22)    :: charout 
    56       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd   ! 4D workspace 
     48      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   ztrtrd   ! 4D workspace 
    5749      !!--------------------------------------------------------------------- 
    5850      ! 
    5951      IF( nn_timing == 1 )  CALL timing_start('trc_zdf') 
    6052      ! 
    61       IF( l_trdtrc )  THEN 
    62          CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 
    63          ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
    64       ENDIF 
    65  
    66       SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend 
    67       CASE ( 0 ) ;  CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dttrc, nn_trczdf_exp, trb, tra, jptra )    !   explicit scheme  
    68       CASE ( 1 ) ;  CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc,                trb, tra, jptra )    !   implicit scheme           
    69       END SELECT 
    70  
     53      IF( l_trdtrc )   ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
     54      ! 
     55      CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra )    !   implicit scheme           
     56      ! 
    7157      IF( l_trdtrc )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    7258         DO jn = 1, jptra 
     
    7662            CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 
    7763         END DO 
    78          CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) 
    7964      ENDIF 
    8065      !                                          ! print mean trends (used for debugging) 
    8166      IF( ln_ctl )   THEN 
    82          WRITE(charout, FMT="('zdf ')") ;  CALL prt_ctl_trc_info(charout) 
    83                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     67         WRITE(charout, FMT="('zdf ')") 
     68         CALL prt_ctl_trc_info(charout) 
     69         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    8470      END IF 
    8571      ! 
     
    8773      ! 
    8874   END SUBROUTINE trc_zdf 
    89  
    90  
    91    SUBROUTINE trc_zdf_ini 
    92       !!---------------------------------------------------------------------- 
    93       !!                 ***  ROUTINE trc_zdf_ini  *** 
    94       !! 
    95       !! ** Purpose :   Choose the vertical mixing scheme 
    96       !! 
    97       !! ** Method  :   Set nzdf from ln_zdfexp 
    98       !!      nzdf = 0   explicit (time-splitting) scheme (ln_trczdf_exp=T) 
    99       !!           = 1   implicit (euler backward) scheme (ln_trczdf_exp=F) 
    100       !!      NB: The implicit scheme is required when using :  
    101       !!             - rotated lateral mixing operator 
    102       !!             - TKE, GLS vertical mixing scheme 
    103       !!---------------------------------------------------------------------- 
    104       INTEGER ::  ios                 ! Local integer output status for namelist read 
    105       !! 
    106       NAMELIST/namtrc_zdf/ ln_trczdf_exp  , nn_trczdf_exp 
    107       !!---------------------------------------------------------------------- 
    108       ! 
    109       REWIND( numnat_ref )             ! namtrc_zdf in reference namelist  
    110       READ  ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905) 
    111 905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp ) 
    112       ! 
    113       REWIND( numnat_cfg )             ! namtrc_zdf in configuration namelist  
    114       READ  ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 ) 
    115 906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp ) 
    116       IF(lwm) WRITE ( numont, namtrc_zdf ) 
    117       ! 
    118       IF(lwp) THEN                     ! Control print 
    119          WRITE(numout,*) 
    120          WRITE(numout,*) '   Namelist namtrc_zdf : set vertical diffusion  parameters' 
    121          WRITE(numout,*) '      time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp 
    122          WRITE(numout,*) '      number of time step              nn_trczdf_exp = ', nn_trczdf_exp 
    123       ENDIF 
    124  
    125       !                                ! Define the vertical tracer physics scheme 
    126       IF( ln_trczdf_exp ) THEN   ;   nzdf = 0     ! explicit scheme 
    127       ELSE                       ;   nzdf = 1     ! implicit scheme 
    128       ENDIF 
    129  
    130       !                                ! Force implicit schemes 
    131       IF( ln_trcldf_iso              )   nzdf = 1      ! iso-neutral lateral physics 
    132       IF( ln_trcldf_hor .AND. ln_sco )   nzdf = 1      ! horizontal lateral physics in s-coordinate 
    133 #if defined key_zdftke || defined key_zdfgls  
    134                                          nzdf = 1      ! TKE or GLS physics        
    135 #endif 
    136       IF( ln_trczdf_exp .AND. nzdf == 1 )  &  
    137          CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', & 
    138             &           '          the implicit scheme is required, set ln_trczdf_exp = .false.' ) 
    139  
    140       IF(lwp) THEN 
    141          WRITE(numout,*) 
    142          WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme' 
    143          WRITE(numout,*) '~~~~~~~~~~~' 
    144          IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme' 
    145          IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme' 
    146       ENDIF 
    147       ! 
    148    END SUBROUTINE trc_zdf_ini 
    14975    
    15076#else 
Note: See TracChangeset for help on using the changeset viewer.