Diffusion trends in vertical mixing (trazdf)


Dear All,

Just to know if someone has used outputs of trends produced by trd_tra in routine trazdf.F90.
I really think there is a bug somewhere as these trends are un-realistic (very high).

Any idea or opinion is welcome,



Hi Robinson,

Yes, it is likely that tracer trends are not correct in trazdf. Historically, trazdf, as any other sub-omponents of the time stepping, was outputting trends, not the “after” or “new” value. Based on that, saving trends diagnostics was straightforward. This has however been changed in recent versions of NEMO and may have impacted the trend computation.
I’m afraid you have to carefully check in the code what is saved as “a trend” until a dedicated task is scheduled by the System Team.

1 Like

Hei Jérôme,

But obviously there is a mistake if one checks the code, a few lines below. Basically one saves first tsa (as done in ldftra), and then computes a trend (i.e. divided by 2rdt), but subtracted to tsa. So there is a dimension error obviously, but also what should be the trend is subtracted to the temperature.
Finally, there are very strange things if one compares with ldftra, where only the trend is not divided by rdt, so the ldf trend do not have the same dimension that the zdf trend ?

It’s difficult to understand really… :frowning:

Takk for help,


   IF( l_trdtra )   THEN                  !* Save ta and sa trends
         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
         ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
         ztrds(:,:,:) = tsa(:,:,:,jp_sal)
      !                                      !* compute lateral mixing trend and add it to the general trend
      CALL tra_zdf_imp( kt, nit000, 'TRA', r2dt, tsb, tsa, jpts ) 

!!gm WHY here !   and I don't like that !
      ! DRAKKAR SSS control {
      ! JMM avoid negative salinities near river outlet ! Ugly fix
      ! JMM : restore negative salinities to small salinities:
      WHERE( tsa(:,:,:,jp_sal) < 0._wp )   tsa(:,:,:,jp_sal) = 0.1_wp

      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics
         DO jk = 1, jpkm1
            ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_tem)*e3t_b(:,:,jk) ) &
               &          / (e3t_n(:,:,jk)*r2dt) ) - ztrdt(:,:,jk)
            ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_sal)*e3t_b(:,:,jk) ) &
              &           / (e3t_n(:,:,jk)*r2dt) ) - ztrds(:,:,jk)
         END DO
!!gm this should be moved in trdtra.F90 and done on all trends
         CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1. , ztrds, 'T', 1. )
         CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdf, ztrdt )
         CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdf, ztrds )