And vertical diffusion of momentum
! 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?