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 6060 for branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90 – NEMO

Ignore:
Timestamp:
2015-12-16T10:25:22+01:00 (8 years ago)
Author:
timgraham
Message:

Merged dev_r5836_noc2_VVL_BY_DEFAULT into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90

    r5930 r6060  
    99 
    1010   !!---------------------------------------------------------------------- 
    11    !!   tra_zdf      : Update the tracer trend with the vertical diffusion 
    12    !!   tra_zdf_init : initialisation of the computation 
     11   !!   tra_zdf       : Update the tracer trend with the vertical diffusion 
     12   !!   tra_zdf_init  : initialisation of the computation 
    1313   !!---------------------------------------------------------------------- 
    14    USE oce             ! ocean dynamics and tracers variables 
    15    USE dom_oce         ! ocean space and time domain variables  
    16    USE domvvl          ! variable volume 
    17    USE phycst          ! physical constant 
    18    USE zdf_oce         ! ocean vertical physics variables 
    19    USE sbc_oce         ! surface boundary condition: ocean 
     14   USE oce            ! ocean dynamics and tracers variables 
     15   USE dom_oce        ! ocean space and time domain variables  
     16   USE domvvl         ! variable volume 
     17   USE phycst         ! physical constant 
     18   USE zdf_oce        ! ocean vertical physics variables 
     19   USE sbc_oce        ! surface boundary condition: ocean 
     20   USE ldftra         ! lateral diffusion: eddy diffusivity 
     21   USE ldfslp         ! lateral diffusion: iso-neutral slope  
     22   USE trazdf_exp     ! vertical diffusion: explicit (tra_zdf_exp routine) 
     23   USE trazdf_imp     ! vertical diffusion: implicit (tra_zdf_imp routine) 
     24   USE trd_oce        ! trends: ocean variables 
     25   USE trdtra         ! trends: tracer trend manager 
    2026   ! 
    21    USE ldftra          ! lateral diffusion: eddy diffusivity 
    22    USE ldfslp          ! lateral diffusion: iso-neutral slope  
    23    USE trazdf_exp      ! vertical diffusion: explicit (tra_zdf_exp     routine) 
    24    USE trazdf_imp      ! vertical diffusion: implicit (tra_zdf_imp     routine) 
    25    ! 
    26    USE trd_oce         ! trends: ocean variables 
    27    USE trdtra          ! trends manager: tracers  
    28    ! 
    29    USE in_out_manager  ! I/O manager 
    30    USE prtctl          ! Print control 
    31    USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    32    USE lib_mpp         ! MPP library 
    33    USE wrk_nemo        ! Memory allocation 
    34    USE timing          ! Timing 
     27   USE in_out_manager ! I/O manager 
     28   USE prtctl         ! Print control 
     29   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     30   USE lib_mpp        ! MPP library 
     31   USE wrk_nemo       ! Memory allocation 
     32   USE timing         ! Timing 
    3533 
    3634   IMPLICIT NONE 
     
    4341 
    4442   !! * Substitutions 
    45 #  include "domzgr_substitute.h90" 
    4643#  include "zdfddm_substitute.h90" 
    4744#  include "vectopt_loop_substitute.h90" 
     
    6057      !!--------------------------------------------------------------------- 
    6158      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    62       !! 
     59      ! 
    6360      INTEGER  ::   jk                   ! Dummy loop indices 
    6461      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrdt, ztrds   ! 3D workspace 
     
    7269         r2dtra(:) = 2. * rdttra(:)                      ! = 2 rdttra (leapfrog) 
    7370      ENDIF 
    74  
     71      ! 
    7572      IF( l_trdtra )   THEN                    !* Save ta and sa trends 
    7673         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     
    7875         ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
    7976      ENDIF 
    80  
     77      ! 
    8178      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend 
    8279      CASE ( 0 )    ;    CALL tra_zdf_exp( kt, nit000, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts )  !   explicit scheme  
     
    8784      ! JMM avoid negative salinities near river outlet ! Ugly fix 
    8885      ! JMM : restore negative salinities to small salinities: 
    89       WHERE ( tsa(:,:,:,jp_sal) < 0._wp )   tsa(:,:,:,jp_sal) = 0.1_wp 
     86      WHERE( tsa(:,:,:,jp_sal) < 0._wp )   tsa(:,:,:,jp_sal) = 0.1_wp 
    9087!!gm 
    9188 
     
    103100         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
    104101      ENDIF 
    105  
    106102      !                                          ! print mean trends (used for debugging) 
    107103      IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf  - Ta: ', mask1=tmask,               & 
     
    128124      USE zdfgls 
    129125      !!---------------------------------------------------------------------- 
    130  
     126      ! 
    131127      ! Choice from ln_zdfexp already read in namelist in zdfini module 
    132128      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme 
    133129      ELSE                   ;   nzdf = 1           ! use implicit scheme 
    134130      ENDIF 
    135  
     131      ! 
    136132      ! Force implicit schemes 
    137133      IF( lk_zdftke .OR. lk_zdfgls   )   nzdf = 1   ! TKE, or GLS physics 
     
    140136      IF( ln_zdfexp .AND. nzdf == 1 )   CALL ctl_stop( 'tra_zdf : If using the rotation of lateral mixing operator',   & 
    141137            &                         ' GLS or TKE scheme, the implicit scheme is required, set ln_zdfexp = .false.' ) 
    142  
     138            ! 
    143139      IF(lwp) THEN 
    144140         WRITE(numout,*) 
Note: See TracChangeset for help on using the changeset viewer.