Index: branches/UKMO/r6232_tracer_advection/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- branches/UKMO/r6232_tracer_advection/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 9295)
+++ branches/UKMO/r6232_tracer_advection/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 9299)
@@ -285,51 +285,59 @@
       !! ** Purpose :   output 3D tracer trends using IOM
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend 
-      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend
-      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index
-      INTEGER                   , INTENT(in   ) ::   kt      ! time step
-      !!
-      INTEGER ::   ji, jj, jk   ! dummy loop indices
-      INTEGER ::   ikbu, ikbv   ! local integers
-      REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace 
-      !!----------------------------------------------------------------------
-      !
-!!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added
-      !
-      SELECT CASE( ktrd )
-      CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection
-                               CALL iom_put( "strd_xad" , ptrdy )
-      CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection
-                               CALL iom_put( "strd_yad" , ptrdy )
-      CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection
-                               CALL iom_put( "strd_zad" , ptrdy )
-                               IF( .NOT. lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface
-                               	 CALL wrk_alloc( jpi, jpj, z2dx, z2dy )
-                                  z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1)
-                                  z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1)
-                                  CALL iom_put( "ttrd_sad", z2dx )
-                                  CALL iom_put( "strd_sad", z2dy )
-                                  CALL wrk_dealloc( jpi, jpj, z2dx, z2dy )
-                               ENDIF
-      CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion
-                               CALL iom_put( "strd_ldf" , ptrdy )
-      CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution)
-                               CALL iom_put( "strd_zdf" , ptrdy )
-      CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution)
-                               CALL iom_put( "strd_zdfp", ptrdy )
-      CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping)
-                               CALL iom_put( "strd_dmp" , ptrdy )
-      CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer
-                               CALL iom_put( "strd_bbl" , ptrdy )
-      CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing
-                               CALL iom_put( "strd_npc" , ptrdy )
-      CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx )        ! surface forcing + runoff (ln_rnf=T)
-                               CALL iom_put( "strd_cdt" , ptrdy )
-      CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature)
-      CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature)
-      CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter
-                               CALL iom_put( "strd_atf" , ptrdy )
-      END SELECT
-      !
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
+      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
+      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
+      !! 
+      INTEGER ::   ji, jj, jk   ! dummy loop indices 
+      INTEGER ::   ikbu, ikbv   ! local integers 
+      REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy   ! 2D workspace  
+      !!---------------------------------------------------------------------- 
+      ! 
+      !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 
+      ! 
+      ! These trends are done every second time step. When 1ts output is selected must go different (2ts) file from standard T-file 
+      IF( MOD( kt, 2 ) == 0 ) THEN 
+         SELECT CASE( ktrd ) 
+         CASE( jptra_xad  )   ;   CALL iom_put( "ttrd_xad" , ptrdx )        ! x- horizontal advection 
+            CALL iom_put( "strd_xad" , ptrdy ) 
+         CASE( jptra_yad  )   ;   CALL iom_put( "ttrd_yad" , ptrdx )        ! y- horizontal advection 
+            CALL iom_put( "strd_yad" , ptrdy ) 
+         CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection 
+            CALL iom_put( "strd_zad" , ptrdy ) 
+            IF( .NOT. lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface 
+               CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 
+               z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 
+               z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 
+               CALL iom_put( "ttrd_sad", z2dx ) 
+               CALL iom_put( "strd_sad", z2dy ) 
+               CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 
+            ENDIF 
+         CASE( jptra_ldf  )   ;   CALL iom_put( "ttrd_ldf" , ptrdx )        ! lateral diffusion 
+            CALL iom_put( "strd_ldf" , ptrdy ) 
+         CASE( jptra_zdf  )   ;   CALL iom_put( "ttrd_zdf" , ptrdx )        ! vertical diffusion (including Kz contribution) 
+            CALL iom_put( "strd_zdf" , ptrdy ) 
+         CASE( jptra_zdfp )   ;   CALL iom_put( "ttrd_zdfp", ptrdx )        ! PURE vertical diffusion (no isoneutral contribution) 
+            CALL iom_put( "strd_zdfp", ptrdy ) 
+         CASE( jptra_dmp  )   ;   CALL iom_put( "ttrd_dmp" , ptrdx )        ! internal restoring (damping) 
+            CALL iom_put( "strd_dmp" , ptrdy ) 
+         CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl" , ptrdx )        ! bottom boundary layer 
+            CALL iom_put( "strd_bbl" , ptrdy ) 
+         CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc" , ptrdx )        ! static instability mixing 
+            CALL iom_put( "strd_npc" , ptrdy ) 
+         CASE( jptra_bbc  )   ;   CALL iom_put( "ttrd_bbc" , ptrdx )        ! geothermal heating   (only on temperature) 
+         CASE( jptra_nsr  )   ;   CALL iom_put( "ttrd_qns" , ptrdx(:,:,1) ) ! surface forcing + runoff (ln_rnf=T) 
+            CALL iom_put( "strd_cdt" , ptrdy(:,:,1) )        ! output as 2D surface fields 
+         CASE( jptra_qsr  )   ;   CALL iom_put( "ttrd_qsr" , ptrdx )        ! penetrative solar radiat. (only on temperature) 
+         END SELECT 
+         ! the Asselin filter trend  is also every other time step but needs to be lagged one time step 
+         ! Even when 1ts output is selected can go to the same (2ts) file as the trends plotted every even time step. 
+      ELSE IF( MOD( kt, 2 ) == 1 ) THEN 
+         SELECT CASE( ktrd ) 
+         CASE( jptra_atf  )   ;   CALL iom_put( "ttrd_atf" , ptrdx )        ! asselin time Filter 
+            CALL iom_put( "strd_atf" , ptrdy ) 
+         END SELECT 
+      END IF 
+      ! 
    END SUBROUTINE trd_tra_iom
 
