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 9490 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90 – NEMO

Ignore:
Timestamp:
2018-04-23T10:44:07+02:00 (6 years ago)
Author:
gm
Message:

#2075 - dev_merge_2017: scale-aware setting of lateral viscous and diffusive coefficient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r9169 r9490  
    3333   PUBLIC   trc_ldf_ini    
    3434   ! 
    35    LOGICAL , PUBLIC ::   ln_trcldf_NONE      !: No operator (no explicit lateral diffusion) 
    36    LOGICAL , PUBLIC ::   ln_trcldf_lap       !:   laplacian operator 
    37    LOGICAL , PUBLIC ::   ln_trcldf_blp       !: bilaplacian operator 
    38    LOGICAL , PUBLIC ::   ln_trcldf_lev       !: iso-level   direction 
    39    LOGICAL , PUBLIC ::   ln_trcldf_hor       !: horizontal  direction (rotation to geopotential) 
    40    LOGICAL , PUBLIC ::   ln_trcldf_iso       !: iso-neutral direction (standard) 
    41    LOGICAL , PUBLIC ::   ln_trcldf_triad     !: iso-neutral direction (triad) 
    42    REAL(wp), PUBLIC ::   rn_ahtrc_0          !:   laplacian diffusivity coefficient for passive tracer [m2/s] 
    43    REAL(wp), PUBLIC ::   rn_bhtrc_0          !: bilaplacian      -          --     -       -   [m4/s] 
    44    REAL(wp), PUBLIC ::   rn_fact_lap         !: Enhanced zonal diffusivity coefficent in the equatorial domain 
     35   !                                      !!: ** lateral mixing namelist (nam_trcldf) ** 
     36   LOGICAL , PUBLIC ::   ln_trcldf_NONE    !: No operator (no explicit lateral diffusion) 
     37   LOGICAL , PUBLIC ::   ln_trcldf_tra     !: use active tracer operator 
     38   REAL(wp), PUBLIC ::      rn_ldf_multi      !: multiplier of T-S eddy diffusivity to obtain the passive tracer one 
     39   REAL(wp), PUBLIC ::      rn_fact_lap       !: enhanced Equatorial zonal diffusivity coefficent 
    4540   ! 
    46    !                      !!: ** lateral mixing namelist (nam_trcldf) ** 
    47    REAL(wp) ::  rldf       ! ratio between active and passive tracers diffusive coefficient 
    48     
    49    INTEGER  ::  nldf       ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 
     41   INTEGER  ::   nldf_trc = 0   ! type of lateral diffusion used defined from ln_traldf_... (namlist logicals) 
     42   REAL(wp) ::   rldf           ! multiplier between active and passive tracers eddy diffusivity   [-] 
    5043    
    5144   !! * Substitutions 
     
    7467      !!---------------------------------------------------------------------- 
    7568      ! 
     69      IF( ln_trcldf_NONE )   RETURN       ! not lateral diffusion applied on passive tracers 
     70      ! 
    7671      IF( ln_timing )   CALL timing_start('trc_ldf') 
    7772      ! 
     
    9590      END DO 
    9691      ! 
    97       SELECT CASE ( nldf )                     !* compute lateral mixing trend and add it to the general trend 
     92      SELECT CASE ( nldf_trc )                 !* compute lateral mixing trend and add it to the general trend 
    9893      ! 
    9994      CASE ( np_lap   )                               ! iso-level laplacian 
    100          CALL tra_ldf_lap  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb,      tra, jptra,  1   ) 
     95         CALL tra_ldf_lap  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb,      tra, jptra,    1     ) 
    10196      CASE ( np_lap_i )                               ! laplacian : standard iso-neutral operator (Madec) 
    102          CALL tra_ldf_iso  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb, trb, tra, jptra,  1   ) 
     97         CALL tra_ldf_iso  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb, trb, tra, jptra,    1     ) 
    10398      CASE ( np_lap_it )                              ! laplacian : triad iso-neutral operator (griffies) 
    104          CALL tra_ldf_triad( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb, trb, tra, jptra,  1   ) 
     99         CALL tra_ldf_triad( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb, trb, tra, jptra,    1     ) 
    105100      CASE ( np_blp , np_blp_i , np_blp_it )          ! bilaplacian: all operator (iso-level, -neutral) 
    106          CALL tra_ldf_blp  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb     , tra, jptra, nldf ) 
     101         CALL tra_ldf_blp  ( kt, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi, trb     , tra, jptra, nldf_trc ) 
    107102      END SELECT 
    108103      ! 
     
    132127      !! ** Purpose :   Define the operator for the lateral diffusion 
    133128      !! 
    134       !! ** Method  :   set nldf from the namtra_ldf logicals 
    135       !!      nldf ==  0   laplacian operator 
    136       !!      nldf ==  1   Rotated laplacian operator 
    137       !!      nldf ==  2   bilaplacian operator 
    138       !!      nldf ==  3   Rotated bilaplacian 
     129      !! ** Method  : - ln_trcldf_tra =T : use nldf_tra set in ldftra module  
     130      !!              to defined the passive tracer lateral diffusive operator 
     131      !!              - ln_trcldf_NONE=T : no explicit diffusion used 
    139132      !!---------------------------------------------------------------------- 
    140       INTEGER ::   ioptio, ierr   ! temporary integers 
    141       INTEGER ::   ios            ! Local integer output status for namelist read 
     133      INTEGER ::   ios, ioptio   ! local integers 
    142134      !! 
    143       NAMELIST/namtrc_ldf/ ln_trcldf_lap, ln_trcldf_blp,                                  & 
    144          &                 ln_trcldf_lev, ln_trcldf_hor, ln_trcldf_iso, ln_trcldf_triad,  & 
    145          &                 rn_ahtrc_0   , rn_bhtrc_0   , rn_fact_lap   
     135      NAMELIST/namtrc_ldf/ ln_trcldf_NONE, ln_trcldf_tra,   &   ! operator & direction 
     136         &                 rn_ldf_multi  , rn_fact_lap          ! coefficient 
    146137      !!---------------------------------------------------------------------- 
     138      ! 
     139      IF(lwp) THEN 
     140         WRITE(numout,*) 
     141         WRITE(numout,*) 'trc_ldf_ini : lateral passive tracer diffusive operator' 
     142         WRITE(numout,*) '~~~~~~~~~~~' 
     143      ENDIF 
    147144      ! 
    148145      REWIND( numnat_ref )             !  namtrc_ldf in reference namelist  
     
    156153      ! 
    157154      IF(lwp) THEN                     ! Namelist print 
    158          WRITE(numout,*) 
    159          WRITE(numout,*) 'trc_ldf_ini : lateral tracer diffusive operator' 
    160          WRITE(numout,*) '~~~~~~~~~~~' 
    161155         WRITE(numout,*) '   Namelist namtrc_ldf : set lateral mixing parameters (type, direction, coefficients)' 
    162          WRITE(numout,*) '      operator' 
    163          WRITE(numout,*) '         no explicit diffusion       ln_trcldf_NONE  = ', ln_trcldf_NONE 
    164          WRITE(numout,*) '           laplacian                 ln_trcldf_lap   = ', ln_trcldf_lap 
    165          WRITE(numout,*) '         bilaplacian                 ln_trcldf_blp   = ', ln_trcldf_blp 
    166          WRITE(numout,*) '      direction of action' 
    167          WRITE(numout,*) '         iso-level                   ln_trcldf_lev   = ', ln_trcldf_lev 
    168          WRITE(numout,*) '         horizontal (geopotential)   ln_trcldf_hor   = ', ln_trcldf_hor 
    169          WRITE(numout,*) '         iso-neutral (standard)      ln_trcldf_iso   = ', ln_trcldf_iso 
    170          WRITE(numout,*) '         iso-neutral (triad)         ln_trcldf_triad = ', ln_trcldf_triad 
    171          WRITE(numout,*) '      diffusivity coefficient' 
    172          WRITE(numout,*) '           laplacian                 rn_ahtrc_0      = ', rn_ahtrc_0 
    173          WRITE(numout,*) '         bilaplacian                 rn_bhtrc_0      = ', rn_bhtrc_0 
    174          WRITE(numout,*) '      enhanced zonal diffusivity     rn_fact_lap     = ', rn_fact_lap 
     156         WRITE(numout,*) '      no explicit diffusion                 ln_trcldf_NONE  = ', ln_trcldf_NONE 
     157         WRITE(numout,*) '      use active tracer operator            ln_trcldf_tra   = ', ln_trcldf_tra 
     158         WRITE(numout,*) '      diffusivity coefficient :' 
     159         WRITE(numout,*) '         multiplier of TRA coef. for TRC          rn_ldf_multi = ', rn_ldf_multi 
     160         WRITE(numout,*) '         enhanced zonal Eq. laplacian coef.       rn_fact_lap  = ', rn_fact_lap 
    175161 
    176162      ENDIF 
    177163      !       
    178164      !                                ! control the namelist parameters 
    179       ioptio = 0 
    180       IF( ln_trcldf_NONE ) THEN   ;   nldf = np_no_ldf   ;   ioptio = ioptio + 1   ;   ENDIF 
    181       IF( ln_trcldf_lap  ) THEN   ;                          ioptio = ioptio + 1   ;   ENDIF 
    182       IF( ln_trcldf_blp  ) THEN   ;                          ioptio = ioptio + 1   ;   ENDIF 
    183       IF( ioptio /=  1   )   CALL ctl_stop( 'trc_ldf_ini: use ONE of the 3 operator options (NONE/lap/blp)' ) 
     165      nldf_trc = np_ERROR 
     166      ioptio   = 0 
     167      IF( ln_trcldf_NONE ) THEN   ;   nldf_trc = np_no_ldf   ;   ioptio = ioptio + 1   ;   ENDIF 
     168      IF( ln_trcldf_tra  ) THEN   ;   nldf_trc = nldf_tra    ;   ioptio = ioptio + 1   ;   ENDIF 
     169      IF( ioptio /=  1   )   CALL ctl_stop( 'trc_ldf_ini: use ONE of the 2 operator options (NONE/tra)' ) 
    184170       
    185       IF( ln_trcldf_lap .AND. .NOT.ln_traldf_lap )   CALL ctl_stop( 'trc_ldf_ini:   laplacian should be used on both TRC and TRA' ) 
    186       IF( ln_trcldf_blp .AND. .NOT.ln_traldf_blp )   CALL ctl_stop( 'trc_ldf_ini: bilaplacian should be used on both TRC and TRA' ) 
    187       ! 
    188       IF( .NOT.ln_trcldf_NONE ) THEN   ! direction ==>> type of operator  
    189          ioptio = 0 
    190          IF( ln_trcldf_lev )   ioptio = ioptio + 1 
    191          IF( ln_trcldf_hor )   ioptio = ioptio + 1 
    192          IF( ln_trcldf_iso )   ioptio = ioptio + 1 
    193          IF( ioptio /= 1   )   CALL ctl_stop( 'trc_ldf_ini: use ONE direction (level/hor/iso)' ) 
    194          ! 
    195          ! defined the type of lateral diffusion from ln_trcldf_... logicals 
    196          ! CAUTION : nldf = 1 is used in trazdf_imp, change it carefully 
    197          ierr = 0 
    198          IF( ln_trcldf_lap ) THEN      !==  laplacian operator  ==! 
    199             IF( ln_zco ) THEN                ! z-coordinate 
    200                IF( ln_trcldf_lev   )   nldf = np_lap     ! iso-level = horizontal (no rotation) 
    201                IF( ln_trcldf_hor   )   nldf = np_lap     ! iso-level = horizontal (no rotation) 
    202                IF( ln_trcldf_iso   )   nldf = np_lap_i   ! iso-neutral: standard  (   rotation) 
    203                IF( ln_trcldf_triad )   nldf = np_lap_it  ! iso-neutral: triad     (   rotation) 
    204             ENDIF 
    205             IF( ln_zps ) THEN             ! z-coordinate with partial step 
    206                IF( ln_trcldf_lev   )   ierr = 1          ! iso-level not allowed  
    207                IF( ln_trcldf_hor   )   nldf = np_lap     ! horizontal (no rotation) 
    208                IF( ln_trcldf_iso   )   nldf = np_lap_i   ! iso-neutral: standard (rotation) 
    209                IF( ln_trcldf_triad )   nldf = np_lap_it  ! iso-neutral: triad    (rotation) 
    210             ENDIF 
    211             IF( ln_sco ) THEN             ! s-coordinate 
    212                IF( ln_trcldf_lev   )   nldf = np_lap     ! iso-level  (no rotation) 
    213                IF( ln_trcldf_hor   )   nldf = np_lap_it  ! horizontal (   rotation)       !!gm   a checker.... 
    214                IF( ln_trcldf_iso   )   nldf = np_lap_i   ! iso-neutral: standard (rotation) 
    215                IF( ln_trcldf_triad )   nldf = np_lap_it  ! iso-neutral: triad    (rotation) 
    216             ENDIF 
    217             !                                ! diffusivity ratio: passive / active tracers  
    218             IF( ABS(rn_aht_0) < 2._wp*TINY(1._wp) ) THEN 
    219                IF( ABS(rn_ahtrc_0) < 2._wp*TINY(1._wp) ) THEN 
    220                   rldf = 1.0_wp 
    221                ELSE 
    222                   CALL ctl_stop( 'trc_ldf_ctl : cannot define rldf, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
    223                ENDIF 
    224             ELSE 
    225                rldf = rn_ahtrc_0 / rn_aht_0 
    226             ENDIF 
    227          ENDIF 
    228          ! 
    229          IF( ln_trcldf_blp ) THEN      !==  bilaplacian operator  ==! 
    230             IF ( ln_zco ) THEN                ! z-coordinate 
    231                IF ( ln_trcldf_lev   )   nldf = np_blp     ! iso-level = horizontal (no rotation) 
    232                IF ( ln_trcldf_hor   )   nldf = np_blp     ! iso-level = horizontal (no rotation) 
    233                IF ( ln_trcldf_iso   )   nldf = np_blp_i   ! iso-neutral: standard (rotation) 
    234                IF ( ln_trcldf_triad )   nldf = np_blp_it  ! iso-neutral: triad    (rotation) 
    235             ENDIF 
    236             IF ( ln_zps ) THEN             ! z-coordinate with partial step 
    237                IF ( ln_trcldf_lev   )   ierr = 1         ! iso-level not allowed  
    238                IF ( ln_trcldf_hor   )   nldf = np_blp     ! horizontal (no rotation) 
    239                IF ( ln_trcldf_iso   )   nldf = np_blp_i   ! iso-neutral: standard (rotation) 
    240                IF ( ln_trcldf_triad )   nldf = np_blp_it  ! iso-neutral: triad    (rotation) 
    241             ENDIF 
    242             IF ( ln_sco ) THEN             ! s-coordinate 
    243                IF ( ln_trcldf_lev   )   nldf = np_blp     ! iso-level  (no rotation) 
    244                IF ( ln_trcldf_hor   )   nldf = np_blp_it  ! horizontal (   rotation)       !!gm   a checker.... 
    245                IF ( ln_trcldf_iso   )   nldf = np_blp_i   ! iso-neutral: standard (rotation) 
    246                IF ( ln_trcldf_triad )   nldf = np_blp_it  ! iso-neutral: triad    (rotation) 
    247             ENDIF 
    248             !                                ! diffusivity ratio: passive / active tracers  
    249             IF( ABS(rn_bht_0) < 2._wp*TINY(1._wp) ) THEN 
    250                IF( ABS(rn_bhtrc_0) < 2._wp*TINY(1._wp) ) THEN 
    251                   rldf = 1.0_wp 
    252                ELSE 
    253                   CALL ctl_stop( 'trc_ldf_ctl : cannot define rldf, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
    254                ENDIF 
    255             ELSE 
    256                rldf = SQRT(  ABS( rn_bhtrc_0 / rn_bht_0 )  ) 
    257             ENDIF 
    258          ENDIF 
    259          ! 
    260          IF( ierr == 1 )   CALL ctl_stop( 'trc_ldf_ini: iso-level in z-partial step, not allowed' ) 
     171      !                                ! multiplier : passive/active tracers ration 
     172      IF( ln_traldf_lap ) THEN               ! laplacian operator 
     173         rldf = rn_ldf_multi                       ! simple multiplier 
     174      ELSEIF( ln_traldf_blp ) THEN           ! bilaplacian operator:  
     175         rldf = SQRT( ABS( rn_ldf_multi )  )       ! the coef. used is the SQRT of the bilaplacian coef. 
    261176      ENDIF 
    262       ! 
    263       IF( ln_ldfeiv .AND. .NOT.ln_trcldf_iso )   CALL ctl_stop( 'trc_ldf_ini: eiv requires isopycnal laplacian diffusion' ) 
    264       IF( nldf == 1 .OR. nldf == 3 )   l_ldfslp = .TRUE.    ! slope of neutral surfaces required  
    265177      ! 
    266178      IF(lwp) THEN 
    267179         WRITE(numout,*) 
    268          SELECT CASE( nldf ) 
     180         SELECT CASE( nldf_trc ) 
    269181         CASE( np_no_ldf )   ;   WRITE(numout,*) '      ===>>   NO lateral diffusion' 
    270182         CASE( np_lap    )   ;   WRITE(numout,*) '      ===>>   laplacian iso-level operator' 
Note: See TracChangeset for help on using the changeset viewer.