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 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trazdf.F90 – NEMO

Ignore:
Timestamp:
2021-05-05T13:18:04+02:00 (3 years ago)
Author:
mcastril
Message:

[2021/HPC-11_mcastril_HPDAonline_DiagGPU] Update externals

Location:
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
         5^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8^/vendors/PPR@HEAD            ext/PPR 
        89 
        910# SETTE 
        10 ^/utils/CI/sette@13559        sette 
         11^/utils/CI/sette@14244        sette 
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trazdf.F90

    r13497 r14789  
    1313   !!---------------------------------------------------------------------- 
    1414   USE oce            ! ocean dynamics and tracers variables 
    15    USE dom_oce        ! ocean space and time domain variables  
     15   USE dom_oce        ! ocean space and time domain variables 
    1616   USE domvvl         ! variable volume 
    1717   USE phycst         ! physical constant 
    1818   USE zdf_oce        ! ocean vertical physics variables 
     19   USE zdfmfc         ! Mass FLux Convection 
    1920   USE sbc_oce        ! surface boundary condition: ocean 
    2021   USE ldftra         ! lateral diffusion: eddy diffusivity 
    21    USE ldfslp         ! lateral diffusion: iso-neutral slope  
     22   USE ldfslp         ! lateral diffusion: iso-neutral slope 
    2223   USE trd_oce        ! trends: ocean variables 
    2324   USE trdtra         ! trends: tracer trend manager 
     25   USE eosbn2, ONLY: ln_SEOS, rn_b0 
    2426   ! 
    2527   USE in_out_manager ! I/O manager 
     
    5557      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts                 ! active tracers and RHS of tracer equation 
    5658      ! 
    57       INTEGER  ::   jk   ! Dummy loop indices 
     59      INTEGER  ::   ji, jj, jk   ! Dummy loop indices 
    5860      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
    5961      !!--------------------------------------------------------------------- 
     
    6264      ! 
    6365      IF( kt == nit000 )  THEN 
    64          IF(lwp)WRITE(numout,*) 
    65          IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 
    66          IF(lwp)WRITE(numout,*) '~~~~~~~ ' 
     66         IF( ntile == 0 .OR. ntile == 1 )  THEN                   ! Do only on the first tile 
     67            IF(lwp)WRITE(numout,*) 
     68            IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 
     69            IF(lwp)WRITE(numout,*) '~~~~~~~ ' 
     70         ENDIF 
    6771      ENDIF 
    6872      ! 
    6973      IF( l_trdtra )   THEN                  !* Save ta and sa trends 
    70          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
     74         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 
    7175         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 
    7276         ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 
     
    7478      ! 
    7579      !                                      !* compute lateral mixing trend and add it to the general trend 
    76       CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts )  
     80      CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts ) 
    7781 
    7882!!gm WHY here !   and I don't like that ! 
     
    8084      ! JMM avoid negative salinities near river outlet ! Ugly fix 
    8185      ! JMM : restore negative salinities to small salinities: 
    82       WHERE( pts(:,:,:,jp_sal,Kaa) < 0._wp )   pts(:,:,:,jp_sal,Kaa) = 0.1_wp 
     86!!jc: discard this correction in case salinity is not used in eos 
     87      IF ( .NOT.(ln_SEOS.AND.(rn_b0==0._wp)) ) THEN 
     88         WHERE( pts(A2D(0),:,jp_sal,Kaa) < 0._wp )   pts(A2D(0),:,jp_sal,Kaa) = 0.1_wp 
     89      ENDIF 
    8390!!gm 
    8491 
    8592      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    86          DO jk = 1, jpkm1 
     93         DO jk = 1, jpk 
    8794            ztrdt(:,:,jk) = (   (  pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa)     & 
    8895               &                 - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb)  )  & 
     
    95102         END DO 
    96103!!gm this should be moved in trdtra.F90 and done on all trends 
    97          CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp ) 
     104         CALL lbc_lnk( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp ) 
    98105!!gm 
    99106         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
     
    109116   END SUBROUTINE tra_zdf 
    110117 
    111   
    112    SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt )  
     118 
     119   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt ) 
    113120      !!---------------------------------------------------------------------- 
    114121      !!                  ***  ROUTINE tra_zdf_imp  *** 
    115122      !! 
    116123      !! ** Purpose :   Compute the after tracer through a implicit computation 
    117       !!     of the vertical tracer diffusion (including the vertical component  
    118       !!     of lateral mixing (only for 2nd order operator, for fourth order  
    119       !!     it is already computed and add to the general trend in traldf)  
     124      !!     of the vertical tracer diffusion (including the vertical component 
     125      !!     of lateral mixing (only for 2nd order operator, for fourth order 
     126      !!     it is already computed and add to the general trend in traldf) 
    120127      !! 
    121128      !! ** Method  :  The vertical diffusion of a tracer ,t , is given by: 
     
    140147      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
    141148      REAL(wp) ::  zrhs, zzwi, zzws ! local scalars 
    142       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwi, zwt, zwd, zws 
     149      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::  zwi, zwt, zwd, zws 
    143150      !!--------------------------------------------------------------------- 
    144151      ! 
     
    154161            ! 
    155162            ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers 
    156             IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt(:,:,2:jpk) 
    157             ELSE                                            ;   zwt(:,:,2:jpk) = avs(:,:,2:jpk) 
     163            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN 
     164               DO_3D( 1, 1, 1, 1, 2, jpk ) 
     165                  zwt(ji,jj,jk) = avt(ji,jj,jk) 
     166               END_3D 
     167            ELSE 
     168               DO_3D( 1, 1, 1, 1, 2, jpk ) 
     169                  zwt(ji,jj,jk) = avs(ji,jj,jk) 
     170               END_3D 
    158171            ENDIF 
    159172            zwt(:,:,1) = 0._wp 
    160173            ! 
    161             IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution  
    162                IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator  
     174            IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution 
     175               IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator 
    163176                  DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
    164                      zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)   
     177                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk) 
    165178                  END_3D 
    166179               ELSE                          ! standard or triad iso-neutral operator 
     
    189202            ENDIF 
    190203            ! 
     204            ! Modification of diagonal to add MF scheme 
     205            IF ( ln_zdfmfc ) THEN 
     206               CALL diag_mfc( zwi, zwd, zws, p2dt, Kaa ) 
     207            END IF 
     208            ! 
    191209            !! Matrix inversion from the first level 
    192210            !!---------------------------------------------------------------------- 
     
    205223            !   The solution will be in the 4d array pta. 
    206224            !   The 3d array zwt is used as a work space array. 
    207             !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then  
     225            !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then 
    208226            !   used as a work space array: its value is modified. 
    209227            ! 
     
    215233            END_3D 
    216234            ! 
    217          ENDIF  
    218          !          
     235         ENDIF 
     236         ! 
     237         ! Modification of rhs to add MF scheme 
     238         IF ( ln_zdfmfc ) THEN 
     239            CALL rhs_mfc( pt(:,:,:,jn,Krhs), jn ) 
     240         END IF 
     241         ! 
    219242         DO_2D( 0, 0, 0, 0 )         !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1 
    220243            pt(ji,jj,1,jn,Kaa) =        e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb)    & 
     
    222245         END_2D 
    223246         DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
    224             zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    &  
     247            zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    & 
    225248               & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side 
    226249            pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa) 
Note: See TracChangeset for help on using the changeset viewer.