# Anisotropic tracer diffusion

**URL:** <https://nemo-ocean.discourse.group/t/anisotropic-tracer-diffusion/248>\
**Category:** Test case\
**Tags:** TRA\
**Created:** [25 March 2022 11:34 UTC](https://nemo-ocean.discourse.group/t/anisotropic-tracer-diffusion/248 "2022-03-25T11:34:50Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![francesco.tuccia](https://yyz2.discourse-cdn.com/free1/user_avatar/nemo-ocean.discourse.group/francesco.tuccia/32/68_2.png) [@francesco.tuccia](https://nemo-ocean.discourse.group/u/francesco.tuccia)\
**Post date:** [5 May 2022 14:02 UTC](https://nemo-ocean.discourse.group/t/anisotropic-tracer-diffusion/248/8 "2022-05-05T14:02:06Z")

</div>

And vertical diffusion of momentum

```fortran
      ! Fluxes
      zwww = 0._wp

      SELECT CASE( kcmp )

         !> @par U Velocity
         CASE ( np_ucmp ) !For U velocity

            ! construction of the vertical flux by interpolation of the variance tensor in 
            ! z and x and multiplication by the derivative of velocity in z
            DO jk = 2, jpkm1
               DO jj = 1, jpjm1
                  DO ji = 1, jpi   
                     zwww(ji,jj,jk) = ( a_ten(ji+1,jj,jk-1,ia33) + a_ten(ji ,jj,jk-1,ia33) + &
                     & a_ten(ji+1,jj,jk ,ia33) + a_ten(ji ,jj,jk ,ia33) ) * 0.25_wp * &
                     & ( pcn(ji ,jj,jk-1) - pcn(ji ,jj,jk ) * wumask(ji,jj,jk) / e3uw_n(ji,jj,jk)
                  END DO
               END DO
            END DO
            !
            zwww(:,:,jpk) = 0._wp ! Avoid bottom boudary fluxes
            !
            ! ! ================
            DO jk = 1, jpkm1 ! Horizontal slab
               ! ! ================
               DO jj = 1, jpj
                  DO ji = 1, jpim1
                     ! Averaging and update of the velocity component
                     ! This is a diffusion component added to the RIGHT-HAND SIDE, so positive
                     pca(ji,jj,jk) = pca(ji,jj,jk) + umask(ji,jj,jk) * &
                     & ( zwww(ji,jj,jk-1) - zwww(ji,jj,jk) ) / e3uw_n(ji,jj,jk)
                  END DO  
               END DO
               ! ! ================
            END DO ! End of slab
            ! ! ================

         !> @par V Velocity
         CASE ( np_vcmp ) !For V velocity 

            ! construction of the vertical flux by interpolation of the variance tensor in 
            ! z and y and multiplication by the derivative of velocity in z
            DO jk = 2, jpkm1
               DO jj = 1, jpj
                  DO ji = 1, jpim1 
                     zwww(ji,jj,jk) = ( a_ten(ji,jj+1,jk,ia33) + a_ten(ji,jj ,jk,ia33) + &
                     & a_ten(ji,jj+1,jk,ia33) + a_ten(ji,jj ,jk,ia33) ) * 0.25_wp * &
                     & ( pcn(ji,jj ,jk-1) - pcn(ji,jj ,jk ) * wvmask(ji,jj,jk) / e3vw_n(ji,jj,jk)
                  END DO
               END DO
            END DO
            !
            zwww(:,:,jpk) = 0._wp ! Avoid bottom boudary fluxes
            !
            ! ! ================
            DO jk = 2, jpkm1 ! Horizontal slab
               ! ! ================
               DO jj = 1, jpjm1
                  DO ji = 1, jpi
                     ! Averaging and update of the velocity component
                     ! This is a diffusion component added to the RIGHT-HAND SIDE, so positive
                     pca(ji,jj,jk) = pca(ji,jj,jk) + vmask(ji,jj,jk) * &
                     & ( zwww(ji,jj,jk-1) - zwww(ji,jj,jk) ) / e3uw_n(ji,jj,jk)
                  END DO  
               END DO
               ! ! ================
            END DO ! End of slab
            ! ! ================
            ! 

         CASE DEFAULT          
           CALL ctl_stop('STOP','new_zzdiff: wrong value for kcmp' )
      END SELECT

```

These last two codes are the most obscure. Going through the NEMO documentation I’ve noticed that vertical diffusion is imposed implicitly, but I can’t find more about the schemes. Can someone give me some hint?

---

_[View the full topic](https://nemo-ocean.discourse.group/t/anisotropic-tracer-diffusion/248)._
