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 14072 for NEMO/trunk/src/OCE/TRA/traadv_fct.F90 – NEMO

Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/TRA/traadv_fct.F90

    r13982 r14072  
    1010   !!  tra_adv_fct    : update the tracer trend with a 3D advective trends using a 2nd or 4th order FCT scheme 
    1111   !!                   with sub-time-stepping in the vertical direction 
    12    !!  nonosc         : compute monotonic tracer fluxes by a non-oscillatory algorithm  
     12   !!  nonosc         : compute monotonic tracer fluxes by a non-oscillatory algorithm 
    1313   !!  interp_4th_cpt : 4th order compact scheme for the vertical component of the advection 
    1414   !!---------------------------------------------------------------------- 
     
    2424   ! 
    2525   USE in_out_manager ! I/O manager 
    26    USE iom            !  
     26   USE iom            ! 
    2727   USE lib_mpp        ! MPP library 
    28    USE lbclnk         ! ocean lateral boundary condition (or mpp link)  
    29    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)   
     28   USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
     29   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    3030 
    3131   IMPLICIT NONE 
     
    6060      !!---------------------------------------------------------------------- 
    6161      !!                  ***  ROUTINE tra_adv_fct  *** 
    62       !!  
     62      !! 
    6363      !! **  Purpose :   Compute the now trend due to total advection of tracers 
    6464      !!               and add it to the general trend of tracer equations 
     
    6666      !! **  Method  : - 2nd or 4th FCT scheme on the horizontal direction 
    6767      !!               (choice through the value of kn_fct) 
    68       !!               - on the vertical the 4th order is a compact scheme  
    69       !!               - corrected flux (monotonic correction)  
     68      !!               - on the vertical the 4th order is a compact scheme 
     69      !!               - corrected flux (monotonic correction) 
    7070      !! 
    7171      !! ** Action : - update pt(:,:,:,:,Krhs)  with the now advective tracer trends 
     
    154154         ! 
    155155         !        !==  upstream advection with initial mass fluxes & intermediate update  ==! 
    156          !                    !* upstream tracer flux in the i and j direction  
     156         !                    !* upstream tracer flux in the i and j direction 
    157157         DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 ) 
    158158            ! upstream scheme 
     
    173173            IF( ln_isfcav ) THEN                        ! top of the ice-shelf cavities and at the ocean surface 
    174174               DO_2D( 1, 1, 1, 1 ) 
    175                   zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface  
     175                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface 
    176176               END_2D 
    177177            ELSE                                        ! no cavities: only at the ocean surface 
     
    181181            ENDIF 
    182182         ENDIF 
    183          !                
     183         ! 
    184184         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )   !* trend and after field with monotonic scheme 
    185185            !                               ! total intermediate advective trends 
     
    193193               &                                  / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk) 
    194194         END_3D 
    195           
     195 
    196196         IF ( ll_zAimp ) THEN 
    197197            CALL tridia_solver( zwdia, zwsup, zwinf, zwi, zwi , 0 ) 
     
    215215         END IF 
    216216         !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes) 
    217          IF( l_ptr )   zptry(:,:,:) = zwy(:,:,:)  
     217         IF( l_ptr )   zptry(:,:,:) = zwy(:,:,:) 
    218218         ! 
    219219         !        !==  anti-diffusive flux : high order minus low order  ==! 
     
    268268               zC4t_u =  zC2t_u + r1_6 * ( ztu(ji-1,jj  ,jk) - ztu(ji+1,jj  ,jk) ) 
    269269               zC4t_v =  zC2t_v + r1_6 * ( ztv(ji  ,jj-1,jk) - ztv(ji  ,jj+1,jk) ) 
    270                !                                                  ! C4 minus upstream advective fluxes  
     270               !                                                  ! C4 minus upstream advective fluxes 
    271271               zwx(ji,jj,jk) =  0.5_wp * pU(ji,jj,jk) * zC4t_u - zwx(ji,jj,jk) 
    272272               zwy(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * zC4t_v - zwy(ji,jj,jk) 
     
    275275            ! 
    276276         END SELECT 
    277          !                       
     277         ! 
    278278         SELECT CASE( kn_fct_v )    !* vertical anti-diffusive fluxes (w-masked interior values) 
    279279         ! 
     
    384384         DEALLOCATE( ztrdx, ztrdy, ztrdz ) 
    385385      ENDIF 
    386       IF( l_ptr ) THEN  
     386      IF( l_ptr ) THEN 
    387387         DEALLOCATE( zptry ) 
    388388      ENDIF 
     
    394394      !!--------------------------------------------------------------------- 
    395395      !!                    ***  ROUTINE nonosc  *** 
    396       !!      
    397       !! **  Purpose :   compute monotonic tracer fluxes from the upstream  
    398       !!       scheme and the before field by a nonoscillatory algorithm  
     396      !! 
     397      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
     398      !!       scheme and the before field by a nonoscillatory algorithm 
    399399      !! 
    400400      !! **  Method  :   ... ??? 
     
    492492      !!---------------------------------------------------------------------- 
    493493      !!                  ***  ROUTINE interp_4th_cpt_org  *** 
    494       !!  
     494      !! 
    495495      !! **  Purpose :   Compute the interpolation of tracer at w-point 
    496496      !! 
     
    503503      REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwd, zwi, zws, zwrm, zwt 
    504504      !!---------------------------------------------------------------------- 
    505        
     505 
    506506      DO_3D( 1, 1, 1, 1, 3, jpkm1 )       !==  build the three diagonal matrix  ==! 
    507507         zwd (ji,jj,jk) = 4._wp 
     
    514514            zwi (ji,jj,jk) = 0._wp 
    515515            zws (ji,jj,jk) = 0._wp 
    516             zwrm(ji,jj,jk) = 0.5 * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) )     
     516            zwrm(ji,jj,jk) = 0.5 * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) ) 
    517517         ENDIF 
    518518      END_3D 
     
    538538      END_2D 
    539539      DO_3D( 1, 1, 1, 1, 3, jpkm1 ) 
    540          pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)              
     540         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1) 
    541541      END_3D 
    542542 
     
    547547         pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 
    548548      END_3D 
    549       !     
     549      ! 
    550550   END SUBROUTINE interp_4th_cpt_org 
    551     
     551 
    552552 
    553553   SUBROUTINE interp_4th_cpt( pt_in, pt_out ) 
    554554      !!---------------------------------------------------------------------- 
    555555      !!                  ***  ROUTINE interp_4th_cpt  *** 
    556       !!  
     556      !! 
    557557      !! **  Purpose :   Compute the interpolation of tracer at w-point 
    558558      !! 
     
    582582!      CASE( np_CEN2 )   ! 2nd order centered  at top & bottom 
    583583!      END SELECT 
    584 !!gm   
     584!!gm 
    585585      ! 
    586586      IF ( ln_isfcav ) THEN            ! set level two values which may not be set in ISF case 
     
    600600         zwi (ji,jj,ikb) = 0._wp 
    601601         zws (ji,jj,ikb) = 0._wp 
    602          zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,ikb-1) + pt_in(ji,jj,ikb) )             
     602         zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,ikb-1) + pt_in(ji,jj,ikb) ) 
    603603      END_2D 
    604604      ! 
     
    616616      END_2D 
    617617      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 3, jpkm1 ) 
    618          pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)              
     618         pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1) 
    619619      END_3D 
    620620 
     
    625625         pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 
    626626      END_3D 
    627       !     
     627      ! 
    628628   END SUBROUTINE interp_4th_cpt 
    629629 
     
    632632      !!---------------------------------------------------------------------- 
    633633      !!                  ***  ROUTINE tridia_solver  *** 
    634       !!  
     634      !! 
    635635      !! **  Purpose :   solve a symmetric 3diagonal system 
    636636      !! 
    637637      !! **  Method  :   solve M.t_out = RHS(t)  where M is a tri diagonal matrix ( jpk*jpk ) 
    638       !!      
     638      !! 
    639639      !!             ( D_1 U_1  0   0   0  )( t_1 )   ( RHS_1 ) 
    640640      !!             ( L_2 D_2 U_2  0   0  )( t_2 )   ( RHS_2 ) 
     
    642642      !!             (        ...          )( ... )   ( ...  ) 
    643643      !!             (  0   0   0  L_k D_k )( t_k )   ( RHS_k ) 
    644       !!      
     644      !! 
    645645      !!        M is decomposed in the product of an upper and lower triangular matrix. 
    646       !!        The tri-diagonals matrix is given as input 3D arrays:   pD, pU, pL  
     646      !!        The tri-diagonals matrix is given as input 3D arrays:   pD, pU, pL 
    647647      !!        (i.e. the Diagonal, the Upper diagonal, and the Lower diagonal). 
    648648      !!        The solution is pta. 
     
    672672      END_2D 
    673673      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, kstart+1, jpkm1 ) 
    674          pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)              
     674         pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1) 
    675675      END_3D 
    676676 
Note: See TracChangeset for help on using the changeset viewer.