The vertical diffusion trend term has issues (utrd_zdf/vtrd_zdf)

, ,

Hi,
We do this message with Véga, trainee with Julie Deshayes and myself at Locean (I am PhD student). We looked at different trends terms in the NEMO.4.0 version. We noticed an issue with utrd_zdf and vtrd_zdf, that seemed defined up to a constant of (x,y), invariant of z. We figured out this constant was the barotropic velocity, that was removed from only one of the two terms ua, ub used to compute the trend at the end of the dynzdf file.

Hence, we did the following modification in the code (dynzdf.F90, lign 128, we only add the IF ( l_trddyn ) THEN - **** - END IF part) :

      IF( ln_drgimp .AND. ln_dynspg_ts ) THEN
         DO jk = 1, jpkm1        ! remove barotropic velocities
            ua(:,:,jk) = ( ua(:,:,jk) - ua_b(:,:) ) * umask(:,:,jk)
            va(:,:,jk) = ( va(:,:,jk) - va_b(:,:) ) * vmask(:,:,jk)
            IF ( l_trddyn ) THEN    !    (and also from the tendency term if needed)
               ztrdu(:,:,jk) =  ztrdu(:,:,jk) - ua_b(:,:)/r2dt * umask(:,:,jk)
               ztrdv(:,:,jk) =  ztrdv(:,:,jk) - va_b(:,:)/r2dt * vmask(:,:,jk)
            END IF 
         END DO

It provides an apparently correct result. Initially, we modified the file at the end, however Gurvan told us to put it rather at the beginning, where the same operation is done for the velocity.

Best,
Corentin and Véga