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 12590 for NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/trazdf.F90 – NEMO

Ignore:
Timestamp:
2020-03-23T22:16:19+01:00 (4 years ago)
Author:
techene
Message:

all: add e3 substitute, OCE/DOM/domzgr_substitute.h90: correct a bug for e3f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/trazdf.F90

    r12377 r12590  
    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 
     
    1919   USE sbc_oce        ! surface boundary condition: ocean 
    2020   USE ldftra         ! lateral diffusion: eddy diffusivity 
    21    USE ldfslp         ! lateral diffusion: iso-neutral slope  
     21   USE ldfslp         ! lateral diffusion: iso-neutral slope 
    2222   USE trd_oce        ! trends: ocean variables 
    2323   USE trdtra         ! trends: tracer trend manager 
     
    3737   !! * Substitutions 
    3838#  include "do_loop_substitute.h90" 
     39#  include "domzgr_substitute.h90" 
    3940   !!---------------------------------------------------------------------- 
    4041   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7778      ! 
    7879      !                                      !* compute lateral mixing trend and add it to the general trend 
    79       CALL tra_zdf_imp( kt, nit000, 'TRA', r2dt, Kbb, Kmm, Krhs, pts, Kaa, jpts )  
     80      CALL tra_zdf_imp( kt, nit000, 'TRA', r2dt, Kbb, Kmm, Krhs, pts, Kaa, jpts ) 
    8081 
    8182!!gm WHY here !   and I don't like that ! 
     
    8889      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    8990         DO jk = 1, jpkm1 
    90             ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) ) & 
    91                &          / (e3t(:,:,jk,Kmm)*r2dt) ) - ztrdt(:,:,jk) 
    92             ztrds(:,:,jk) = ( ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb) ) & 
    93               &           / (e3t(:,:,jk,Kmm)*r2dt) ) - ztrds(:,:,jk) 
     91            ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa)    & 
     92               &              - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) )  & 
     93               &             / (e3t(:,:,jk,Kmm)*r2dt) ) - ztrdt(:,:,jk) 
     94            ztrds(:,:,jk) = ( ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa)    & 
     95               &              - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb) ) & 
     96               &             / (e3t(:,:,jk,Kmm)*r2dt) ) - ztrds(:,:,jk) 
    9497         END DO 
    9598!!gm this should be moved in trdtra.F90 and done on all trends 
     
    108111   END SUBROUTINE tra_zdf 
    109112 
    110   
    111    SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt )  
     113 
     114   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt ) 
    112115      !!---------------------------------------------------------------------- 
    113116      !!                  ***  ROUTINE tra_zdf_imp  *** 
    114117      !! 
    115118      !! ** Purpose :   Compute the after tracer through a implicit computation 
    116       !!     of the vertical tracer diffusion (including the vertical component  
    117       !!     of lateral mixing (only for 2nd order operator, for fourth order  
    118       !!     it is already computed and add to the general trend in traldf)  
     119      !!     of the vertical tracer diffusion (including the vertical component 
     120      !!     of lateral mixing (only for 2nd order operator, for fourth order 
     121      !!     it is already computed and add to the general trend in traldf) 
    119122      !! 
    120123      !! ** Method  :  The vertical diffusion of a tracer ,t , is given by: 
     
    158161            zwt(:,:,1) = 0._wp 
    159162            ! 
    160             IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution  
    161                IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator  
     163            IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution 
     164               IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator 
    162165                  DO_3D_00_00( 2, jpkm1 ) 
    163                      zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)   
     166                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk) 
    164167                  END_3D 
    165168               ELSE                          ! standard or triad iso-neutral operator 
     
    204207            !   The solution will be in the 4d array pta. 
    205208            !   The 3d array zwt is used as a work space array. 
    206             !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then  
     209            !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then 
    207210            !   used as a work space array: its value is modified. 
    208211            ! 
     
    214217            END_3D 
    215218            ! 
    216          ENDIF  
    217          !          
     219         ENDIF 
     220         ! 
    218221         DO_2D_00_00 
    219             pt(ji,jj,1,jn,Kaa) = e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb) + p2dt * e3t(ji,jj,1,Kmm) * pt(ji,jj,1,jn,Krhs) 
     222            pt(ji,jj,1,jn,Kaa) =        e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb)    & 
     223               &               + p2dt * e3t(ji,jj,1,Kmm) * pt(ji,jj,1,jn,Krhs) 
    220224         END_2D 
    221225         DO_3D_00_00( 2, jpkm1 ) 
    222             zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side 
     226            zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    &  
     227               & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side 
    223228            pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa) 
    224229         END_3D 
Note: See TracChangeset for help on using the changeset viewer.