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/traadv_qck.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/traadv_qck.F90

    r5930 r6060  
    3838 
    3939   !! * Substitutions 
    40 #  include "domzgr_substitute.h90" 
    4140#  include "vectopt_loop_substitute.h90" 
    4241   !!---------------------------------------------------------------------- 
     
    7877      !!            prevent the appearance of spurious numerical oscillations 
    7978      !! 
    80       !! ** Action : - update (pta) with the now advective tracer trends 
    81       !!             - save the trends  
     79      !! ** Action : - update pta  with the now advective tracer trends 
     80      !!             - send trends to trdtra module for further diagnostcs (l_trdtra=T) 
     81      !!             - htr_adv, str_adv : poleward advective heat and salt transport (ln_diaptr=T) 
    8282      !! 
    8383      !! ** Reference : Leonard (1979, 1991) 
     
    105105      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE. 
    106106      ! 
    107       ! I. The horizontal fluxes are computed with the QUICKEST + ULTIMATE scheme 
     107      !        ! horizontal fluxes are computed with the QUICKEST + ULTIMATE scheme 
    108108      CALL tra_adv_qck_i( kt, cdtype, p2dt, pun, ptb, ptn, pta, kjpt )  
    109109      CALL tra_adv_qck_j( kt, cdtype, p2dt, pvn, ptb, ptn, pta, kjpt )  
    110110 
    111       ! II. The vertical fluxes are computed with the 2nd order centered scheme 
     111      !        ! vertical fluxes are computed with the 2nd order centered scheme 
    112112      CALL tra_adv_cen2_k( kt, cdtype, pwn,         ptn, pta, kjpt ) 
    113113      ! 
     
    170170               DO ji = fs_2, fs_jpim1   ! vector opt.    
    171171                  zdir = 0.5 + SIGN( 0.5, pun(ji,jj,jk) )   ! if pun > 0 : zdir = 1 otherwise zdir = 0  
    172                   zdx = ( zdir * e1t(ji,jj) + ( 1. - zdir ) * e1t(ji+1,jj) ) * e2u(ji,jj) * fse3u(ji,jj,jk) 
     172                  zdx = ( zdir * e1t(ji,jj) + ( 1. - zdir ) * e1t(ji+1,jj) ) * e2u(ji,jj) * e3u_n(ji,jj,jk) 
    173173                  zwx(ji,jj,jk)  = ABS( pun(ji,jj,jk) ) * zdt / zdx    ! (0<zc_cfl<1 : Courant number on x-direction) 
    174174                  zfc(ji,jj,jk)  = zdir * ptb(ji  ,jj,jk,jn) + ( 1. - zdir ) * ptb(ji+1,jj,jk,jn)  ! FC in the x-direction for T 
     
    216216            DO jj = 2, jpjm1 
    217217               DO ji = fs_2, fs_jpim1   ! vector opt.   
    218                   zbtr = 1. / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) 
     218                  zbtr = r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
    219219                  ! horizontal advective trends 
    220220                  ztra = - zbtr * ( zwx(ji,jj,jk) - zwx(ji-1,jj,jk) ) 
     
    224224            END DO 
    225225         END DO 
    226          !                                 ! trend diagnostics (contribution of upstream fluxes) 
     226         !                                 ! trend diagnostics 
    227227         IF( l_trd )   CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) ) 
    228228         ! 
     
    293293               DO ji = fs_2, fs_jpim1   ! vector opt.    
    294294                  zdir = 0.5 + SIGN( 0.5, pvn(ji,jj,jk) )   ! if pun > 0 : zdir = 1 otherwise zdir = 0  
    295                   zdx = ( zdir * e2t(ji,jj) + ( 1. - zdir ) * e2t(ji,jj+1) ) * e1v(ji,jj) * fse3v(ji,jj,jk) 
     295                  zdx = ( zdir * e2t(ji,jj) + ( 1. - zdir ) * e2t(ji,jj+1) ) * e1v(ji,jj) * e3v_n(ji,jj,jk) 
    296296                  zwy(ji,jj,jk)  = ABS( pvn(ji,jj,jk) ) * zdt / zdx    ! (0<zc_cfl<1 : Courant number on x-direction) 
    297297                  zfc(ji,jj,jk)  = zdir * ptb(ji,jj  ,jk,jn) + ( 1. - zdir ) * ptb(ji,jj+1,jk,jn)  ! FC in the x-direction for T 
     
    340340            DO jj = 2, jpjm1 
    341341               DO ji = fs_2, fs_jpim1   ! vector opt.   
    342                   zbtr = 1. / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) 
     342                  zbtr = r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
    343343                  ! horizontal advective trends 
    344344                  ztra = - zbtr * ( zwy(ji,jj,jk) - zwy(ji,jj-1,jk) ) 
     
    348348            END DO 
    349349         END DO 
    350          !                                 ! trend diagnostics (contribution of upstream fluxes) 
     350         !                                 ! trend diagnostics 
    351351         IF( l_trd )   CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptn(:,:,:,jn) ) 
    352352         !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes) 
     
    381381      CALL wrk_alloc( jpi,jpj,jpk,   zwz ) 
    382382      ! 
    383       !                          ! surface & bottom values  
    384       IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all 
    385                      zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface 
     383      zwz(:,:, 1 ) = 0._wp       ! surface & bottom values set to zero for all tracers 
     384      zwz(:,:,jpk) = 0._wp 
    386385      ! 
    387386      !                                                          ! =========== 
     
    396395            END DO 
    397396         END DO 
    398          IF(.NOT.lk_vvl ) THEN               !* top value   (only in linear free surf. as zwz is multiplied by wmask) 
     397         IF( ln_linssh ) THEN                !* top value   (only in linear free surf. as zwz is multiplied by wmask) 
    399398            IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean) 
    400399               DO jj = 1, jpj 
     
    403402                  END DO 
    404403               END DO    
    405             ELSE                                   ! no ice-shelf cavities (only ocean surface) 
     404            ELSE                                   ! no ocean cavities (only ocean surface) 
    406405               zwz(:,:,1) = pwn(:,:,1) * ptn(:,:,1,jn) 
    407406            ENDIF 
     
    412411               DO ji = fs_2, fs_jpim1   ! vector opt. 
    413412                  pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) - ( zwz(ji,jj,jk) - zwz(ji,jj,jk+1) )   & 
    414                      &                                / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    415                END DO 
    416             END DO 
    417          END DO 
    418          !                                 ! Save the vertical advective trends for diagnostic 
     413                     &                                * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
     414               END DO 
     415            END DO 
     416         END DO 
     417         !                                 ! Send trends for diagnostic 
    419418         IF( l_trd )  CALL trd_tra( kt, cdtype, jn, jptra_zad, zwz, pwn, ptn(:,:,:,jn) ) 
    420419         ! 
    421420      END DO 
    422421      ! 
    423       CALL wrk_dealloc( jpi, jpj, jpk, zwz ) 
     422      CALL wrk_dealloc( jpi,jpj,jpk,  zwz ) 
    424423      ! 
    425424   END SUBROUTINE tra_adv_cen2_k 
Note: See TracChangeset for help on using the changeset viewer.