Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90	(revision 10115)
@@ -25,10 +25,15 @@
    USE par_c14b   , ONLY : jp_c14b_trd     !: number of tracers in C14
 
+   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC
+
    IMPLICIT NONE
 
-   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_cfc     + jp_c14b     !: 
-   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d  !:
-   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d  !:
-   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd !:
+   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_my_trc     + jp_cfc     + jp_c14b     !: 
+   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_my_trc_2d  + jp_cfc_2d  + jp_c14b_2d  !:
+   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_my_trc_3d  + jp_cfc_3d  + jp_c14b_3d  !:
+   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_my_trc_trd + jp_cfc_trd + jp_c14b_trd !:
 
 #if defined key_age
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90	(revision 10115)
@@ -14,4 +14,5 @@
    USE oce_trc         ! Ocean variables
    USE trcsms_age      ! AGE specific variable
+   USE trc
 
    IMPLICIT NONE
@@ -44,4 +45,9 @@
       NAMELIST/namage/ rn_age_depth, rn_age_kill_rate 
       !!----------------------------------------------------------------------
+      ! Variable setting
+      ctrcnm    (jp_age0) = 'Age'
+      ctrcln    (jp_age0) = 'Sea water age since surface contact'
+      ctrcun    (jp_age0) = 'year'
+      ln_trc_ini(jp_age0) = .false.
       !                             ! Open namelist files
       CALL ctl_opn( numnatg_ref, 'namelist_age_ref'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90	(revision 10115)
@@ -33,5 +33,5 @@
       INTEGER              :: jn
       !!---------------------------------------------------------------------
-
+      IF( ln_crs_top ) CALL iom_swap( "nemo_crs" )
  
       ! write the tracer concentrations in the file
@@ -39,7 +39,9 @@
       DO jn = jp_age0, jp_age1
          cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer
+         IF(lwp)WRITE(numout,*)"WRITE ",TRIM(cltra)
          CALL iom_put( TRIM(cltra), trn(:,:,:,jn) )
       END DO
       !
+      IF( ln_crs_top ) CALL iom_swap( "nemo" )
       !
    END SUBROUTINE trc_wri_age
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90	(revision 10115)
@@ -11,4 +11,9 @@
    USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES
 
+   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC
+
    USE par_cfc    , ONLY : jp_cfc          !: number of tracers in CFC
    USE par_cfc    , ONLY : jp_cfc_2d       !: number of 2D diag in CFC
@@ -19,8 +24,8 @@
    IMPLICIT NONE
 
-   INTEGER, PARAMETER ::   jp_lb      =  jp_pisces     + jp_cfc     !: cum. number of pass. tracers
-   INTEGER, PARAMETER ::   jp_lb_2d   =  jp_pisces_2d  + jp_cfc_2d  !:
-   INTEGER, PARAMETER ::   jp_lb_3d   =  jp_pisces_3d  + jp_cfc_3d  !:
-   INTEGER, PARAMETER ::   jp_lb_trd  =  jp_pisces_trd + jp_cfc_trd !:
+   INTEGER, PARAMETER ::   jp_lb      =  jp_pisces     + jp_my_trc     + jp_cfc     !: cum. number of pass. tracers
+   INTEGER, PARAMETER ::   jp_lb_2d   =  jp_pisces_2d  + jp_my_trc_2d  + jp_cfc_2d  !:
+   INTEGER, PARAMETER ::   jp_lb_3d   =  jp_pisces_3d  + jp_my_trc_3d  + jp_cfc_3d  !:
+   INTEGER, PARAMETER ::   jp_lb_trd  =  jp_pisces_trd + jp_my_trc_trd + jp_cfc_trd !:
    
 #if defined key_c14b
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90	(revision 10115)
@@ -55,4 +55,9 @@
       NAMELIST/namc14dia/  c14dia2d, c14dia3d     ! additional diagnostics
       !!-------------------------------------------------------------------
+      ctrcnm    (jp_c14b0) = 'C14B'
+      ctrcln    (jp_c14b0) = 'Bomb C14 Concentration'
+      ctrcun    (jp_c14b0) = 'ration'
+      ln_trc_ini(jp_c14b0) = .false.
+      ln_trc_wri(jp_c14b0) = .true.
       !                             ! Open namelist file
       CALL ctl_opn( numnatb_ref, 'namelist_c14b_ref'  ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 10115)
@@ -291,6 +291,6 @@
       !    
       IF( lk_iomput ) THEN
-        CALL iom_put( "qtrC14b"  , qtr_c14  )
-        CALL iom_put( "qintC14b" , qint_c14 )
+        CALL iom_put( "qtr_C14b"  , qtr_c14  )
+        CALL iom_put( "qint_C14b" , qint_c14 )
         CALL iom_put( "fdecay"   , zdecay   )
       ELSE
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90	(revision 10115)
@@ -14,11 +14,16 @@
    USE par_pisces , ONLY : jp_pisces_3d    !: number of 3D diag in PISCES
    USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES
+   
+   USE par_my_trc , ONLY : jp_my_trc       !: number of tracers in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_2d    !: number of 2D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_3d    !: number of 3D diag in MY_TRC
+   USE par_my_trc , ONLY : jp_my_trc_trd   !: number of biological diag in MY_TRC
 
    IMPLICIT NONE
 
-   INTEGER, PARAMETER ::   jp_lc      =  jp_pisces     !: cumulative number of passive tracers
-   INTEGER, PARAMETER ::   jp_lc_2d   =  jp_pisces_2d  !:
-   INTEGER, PARAMETER ::   jp_lc_3d   =  jp_pisces_3d  !:
-   INTEGER, PARAMETER ::   jp_lc_trd  =  jp_pisces_trd !:
+   INTEGER, PARAMETER ::   jp_lc      =  jp_pisces     + jp_my_trc     !: cumulative number of passive tracers
+   INTEGER, PARAMETER ::   jp_lc_2d   =  jp_pisces_2d  + jp_my_trc_2d  !:
+   INTEGER, PARAMETER ::   jp_lc_3d   =  jp_pisces_3d  + jp_my_trc_3d  !:
+   INTEGER, PARAMETER ::   jp_lc_trd  =  jp_pisces_trd + jp_my_trc_trd !:
    
 #if defined key_cfc
@@ -27,12 +32,12 @@
    !!---------------------------------------------------------------------
    LOGICAL, PUBLIC, PARAMETER ::   lk_cfc     = .TRUE.      !: CFC flag 
-   INTEGER, PUBLIC, PARAMETER ::   jp_cfc     =  1          !: number of passive tracers
-   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_2d  =  2          !: additional 2d output arrays ('key_trc_diaadd')
+   INTEGER, PUBLIC, PARAMETER ::   jp_cfc     =  2          !: number of passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_cfc_2d  =  2 * jp_cfc !: additional 2d output arrays ('key_trc_diaadd')
    INTEGER, PUBLIC, PARAMETER ::   jp_cfc_3d  =  0          !: additional 3d output arrays ('key_trc_diaadd')
    INTEGER, PUBLIC, PARAMETER ::   jp_cfc_trd =  0          !: number of sms trends for CFC
-   
-   ! assign an index in trc arrays for each CFC prognostic variables
-   INTEGER, PUBLIC, PARAMETER ::   jpc11       = jp_lc + 1   !: CFC-11 
-   INTEGER, PUBLIC, PARAMETER ::   jpc12       = jp_lc + 2   !: CFC-12   
+   ! Enable trace gases according to total number jp_cfc
+   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc11   = .false.     !: use CFC11
+   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc12   = .true.      !: use CFC12
+   LOGICAL, PUBLIC, PARAMETER ::   lp_sf6     = .true.      !: use SF6
 #else
    !!---------------------------------------------------------------------
@@ -44,4 +49,7 @@
    INTEGER, PUBLIC, PARAMETER ::   jp_cfc_3d  =  0          !: No CFC additional 3d output arrays 
    INTEGER, PUBLIC, PARAMETER ::   jp_cfc_trd =  0          !: number of sms trends for CFC
+   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc11   = .false.     !: use CFC11
+   LOGICAL, PUBLIC, PARAMETER ::   lp_cfc12   = .false.     !: use CFC12
+   LOGICAL, PUBLIC, PARAMETER ::   lp_sf6     = .false.     !: use SF6
 #endif
 
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90	(revision 10115)
@@ -22,6 +22,4 @@
    PUBLIC   trc_ini_cfc   ! called by trcini.F90 module
 
-   CHARACTER (len=34) ::   clname = 'cfc1112.atm'   ! ???
-
    INTEGER  ::   inum                   ! unit number
    REAL(wp) ::   ylats = -10.           ! 10 degrees south
@@ -46,4 +44,5 @@
       INTEGER  ::  iskip = 6   ! number of 1st descriptor lines
       REAL(wp) ::  zyy, zyd
+      CHARACTER(len = 20)  ::  cltra
       !!----------------------------------------------------------------------
 
@@ -51,9 +50,8 @@
       IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model'
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
-
-
-      IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm'
+      !
+      IF(lwp) WRITE(numout,*) 'Read annual atmospheric concentrations from formatted file : ' // TRIM(clnamecfc)
       
-      CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      CALL ctl_opn( inum, clnamecfc, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
       REWIND(inum)
       
@@ -66,8 +64,8 @@
       END DO
  100  jpyear = jn - 1 - iskip
-      IF ( lwp) WRITE(numout,*) '    ', jpyear ,' years read'
+      IF ( lwp) WRITE(numout,*) '   --->  ', jpyear ,' years read'
       !                                ! Allocate CFC arrays
 
-      ALLOCATE( p_cfc(jpyear,jphem,2), STAT=ierr )
+      ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr )
       IF( ierr > 0 ) THEN
          CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' )   ;   RETURN
@@ -87,5 +85,5 @@
          IF(lwp) THEN
             WRITE(numout,*)
-            WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero '
+            WRITE(numout,*) 'Initialisation of qint ; No restart : qint equal zero '
          ENDIF
          qint_cfc(:,:,:) = 0._wp
@@ -105,23 +103,14 @@
       jn = 31
       DO 
-        READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2)
+        READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3)
         IF( io < 0 ) exit
         jn = jn + 1
       END DO
 
-      p_cfc(32,1:2,1) = 5.e-4      ! modify the values of the first years
-      p_cfc(33,1:2,1) = 8.e-4
-      p_cfc(34,1:2,1) = 1.e-6
-      p_cfc(35,1:2,1) = 2.e-3
-      p_cfc(36,1:2,1) = 4.e-3
-      p_cfc(37,1:2,1) = 6.e-3
-      p_cfc(38,1:2,1) = 8.e-3
-      p_cfc(39,1:2,1) = 1.e-2
-      
       IF(lwp) THEN        ! Control print
          WRITE(numout,*)
-         WRITE(numout,*) ' Year   p11HN    p11HS    p12HN    p12HS '
+         WRITE(numout,*) ' Year   c11NH     c11SH     c12NH     c12SH     SF6NH     SF6SH'
          DO jn = 30, jpyear
-            WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2)
+            WRITE(numout, '( 1I4, 6F10.4)') jn, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3)
          END DO
       ENDIF
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 10115)
@@ -46,8 +46,8 @@
       INTEGER ::  numonc      = -1   ! Logical unit for output namelist
       INTEGER :: ios                 ! Local integer output status for namelist read
-      INTEGER :: jl, jn
+      INTEGER :: jl, jn, cnt
       TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d
       !!
-      NAMELIST/namcfcdate/ ndate_beg, nyear_res
+      NAMELIST/namcfcdate/ ndate_beg, nyear_res, clnamecfc
       NAMELIST/namcfcdia/  cfcdia2d     ! additional diagnostics
       !!----------------------------------------------------------------------
@@ -66,13 +66,52 @@
       IF(lwm) WRITE ( numonc, namcfcdate )
 
+      jn = jp_cfc0 - 1
+      ! Variables setting
+      IF( lp_cfc11 ) THEN
+         jn = jn + 1
+         ctrcnm    (jn) = 'CFC11'
+         ctrcln    (jn) = 'Chlorofluoro carbon 11 Concentration'
+         ctrcun    (jn) = 'umolC/L'
+         ln_trc_ini(jn) = .false.
+         ln_trc_wri(jn) = .true.
+      ENDIF
+      !
+      IF( lp_cfc12 ) THEN
+         jn = jn + 1
+         ctrcnm    (jn) = 'CFC12'
+         ctrcln    (jn) = 'Chlorofluoro carbon 12 Concentration'
+         ctrcun    (jn) = 'umolC/L'
+         ln_trc_ini(jn) = .false.
+         ln_trc_wri(jn) = .true.
+      ENDIF
+      !
+      IF( lp_sf6 ) THEN
+         jn = jn + 1
+         ctrcnm    (jn) = 'SF6'
+         ctrcln    (jn) = 'Sulfur hexafluoride Concentration'
+         ctrcun    (jn) = 'umol/L'
+         ln_trc_ini(jn) = .false.
+         ln_trc_wri(jn) = .true.
+      ENDIF
+
       IF(lwp) THEN                  ! control print
-         WRITE(numout,*)
+         WRITE(numout,*) ' '
+         WRITE(numout,*) ' CFCs'
+         WRITE(numout,*) ' '
          WRITE(numout,*) ' trc_nam: Read namdates, namelist for CFC chemical model'
          WRITE(numout,*) ' ~~~~~~~'
          WRITE(numout,*) '    initial calendar date (aammjj) for CFC  ndate_beg = ', ndate_beg
          WRITE(numout,*) '    restoring time constant (year)          nyear_res = ', nyear_res
+         WRITE(numout,*) '    Atmospheric CFC concentrations file     clnamecfc = ', TRIM(clnamecfc)
+         WRITE(numout,*) '    Compute dynamics for CFC-11             lp_cfc11  = ', lp_cfc11
+         WRITE(numout,*) '    Compute dynamics for CFC-12             lp_cfc12  = ', lp_cfc12
+         WRITE(numout,*) '    Compute dynamics for SF6                lp_sf6    = ', lp_sf6
       ENDIF
       nyear_beg = ndate_beg / 10000
       IF(lwp) WRITE(numout,*) '    initial year (aa)                       nyear_beg = ', nyear_beg
+      !
+      ! check consistency between CFC namelist and par_cfc setting
+      if ( jn - jp_cfc0 + 1 .ne. jp_cfc )  &
+      CALL ctl_stop( 'trc_nam_cfc: Number of selected CFCs is different from total CFC number (jp_cfc) specified in par_cfc.F90' )
       !
 
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 10115)
@@ -29,8 +29,9 @@
 
    INTEGER , PUBLIC, PARAMETER ::   jphem  =   2   ! parameter for the 2 hemispheres
-   INTEGER , PUBLIC            ::   jpyear         ! Number of years read in CFC1112 file
+   INTEGER , PUBLIC            ::   jpyear         ! Number of years read in input data file (in trcini_cfc)
    INTEGER , PUBLIC            ::   ndate_beg      ! initial calendar date (aammjj) for CFC
    INTEGER , PUBLIC            ::   nyear_res      ! restoring time constant (year)
    INTEGER , PUBLIC            ::   nyear_beg      ! initial year (aa) 
+   CHARACTER(len=200), PUBLIC  ::   clnamecfc      ! Input filename of CFCs atm. concentrations
    
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   p_cfc    ! partial hemispheric pressure for CFC
@@ -38,10 +39,10 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_cfc  ! flux at surface
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qint_cfc ! cumulative flux 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   atm_cfc  ! partial hemispheric pressure for used CFC
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   patm     ! atmospheric function
 
-   REAL(wp), DIMENSION(4,2) ::   soa   ! coefficient for solubility of CFC [mol/l/atm]
-   REAL(wp), DIMENSION(3,2) ::   sob   !    "               "
-   REAL(wp), DIMENSION(4,2) ::   sca   ! coefficients for schmidt number in degre Celcius
-      
+   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   soa      ! coefficient for solubility of CFC [mol/l/atm]
+   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sob      !    "               "
+   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sca      ! coefficients for schmidt number in degrees Celsius
    !                          ! coefficients for conversion
    REAL(wp) ::   xconv1 = 1.0          ! conversion from to 
@@ -82,5 +83,5 @@
       INTEGER  ::   im1, im2, ierr
       REAL(wp) ::   ztap, zdtap        
-      REAL(wp) ::   zt1, zt2, zt3, zv2
+      REAL(wp) ::   zt1, zt2, zt3, zt4, zv2
       REAL(wp) ::   zsol      ! solubility
       REAL(wp) ::   zsch      ! schmidt number 
@@ -93,4 +94,8 @@
       !
       IF( nn_timing == 1 )  CALL timing_start('trc_sms_cfc')
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_sms_cfc:  CFC model'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
       !
       ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr )
@@ -112,6 +117,8 @@
          im2       =      nmonth - 7
       ENDIF
+      ! Avoid bad interpolation if starting date is =< 1900
+      if( iyear_beg .LE. 0 ) iyear_beg = 1
+      !
       iyear_end = iyear_beg + 1
-
       !                                                  !------------!
       DO jl = 1, jp_cfc                                  !  CFC loop  !
@@ -120,6 +127,6 @@
          ! time interpolation at time kt
          DO jm = 1, jphem
-            zpatm(jm,jl) = (  p_cfc(iyear_beg, jm, jl) * FLOAT (im1)  &
-               &           +  p_cfc(iyear_end, jm, jl) * FLOAT (im2) ) / 12.
+            zpatm(jm,jl) = (  atm_cfc(iyear_beg, jm, jl) * REAL(im1, wp)  &
+               &           +  atm_cfc(iyear_end, jm, jl) * REAL(im2, wp) ) / 12.
          END DO
          
@@ -148,14 +155,15 @@
   
                ! Computation of speed transfert
-               !    Schmidt number
+               !    Schmidt number revised in Wanninkhof (2014)
                zt1  = tsn(ji,jj,1,jp_tem)
                zt2  = zt1 * zt1 
                zt3  = zt1 * zt2
-               zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3
-
-               !    speed transfert : formulae of wanninkhof 1992
+               zt4  = zt2 * zt2
+               zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3 + sca(5,jl) * zt4
+
+               !    speed transfert : formulae revised in Wanninkhof (2014)
                zv2     = wndm(ji,jj) * wndm(ji,jj)
                zsch    = zsch / 660.
-               zak_cfc = ( 0.39 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1)
+               zak_cfc = ( 0.31 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1)
 
                ! Input function  : speed *( conc. at equil - concen at surface )
@@ -188,10 +196,18 @@
       !
       IF( lk_iomput ) THEN
-         CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) )
-         CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) )
+         jl = 0
+         DO jn = jp_cfc0, jp_cfc1
+            jl = jl + 1
+            CALL iom_put( 'qtr_'//TRIM(ctrcnm(jn)) , qtr_cfc (:,:,jl) )
+            CALL iom_put( 'qint_'//TRIM(ctrcnm(jn)), qint_cfc(:,:,jl) )
+         ENDDO
       ELSE
          IF( ln_diatrc ) THEN
-            trc2d(:,:,jp_cfc0_2d    ) = qtr_cfc (:,:,1)
-            trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1)
+            jl = 0
+            DO jn = jp_cfc0_2d, jp_cfc1_2d, 2
+               jl = jl + 1
+               trc2d(:,:,jn    ) = qtr_cfc (:,:,jl)
+               trc2d(:,:,jn + 1) = qint_cfc(:,:,jl)
+            ENDDO
          END IF
       END IF
@@ -215,42 +231,81 @@
       !!---------------------------------------------------------------------
       INTEGER :: jn
-
+      !!----------------------------------------------------------------------
+      !
+      jn = 0 
       ! coefficient for CFC11 
       !----------------------
-
-      ! Solubility
-      soa(1,1) = -229.9261 
-      soa(2,1) =  319.6552
-      soa(3,1) =  119.4471
-      soa(4,1) =  -1.39165
-
-      sob(1,1) =  -0.142382
-      sob(2,1) =   0.091459
-      sob(3,1) =  -0.0157274
-
-      ! Schmidt number 
-      sca(1,1) = 3501.8
-      sca(2,1) = -210.31
-      sca(3,1) =  6.1851
-      sca(4,1) = -0.07513
+      if ( lp_cfc11 ) then
+         jn = jn + 1
+         ! Solubility
+         soa(1,jn) = -229.9261 
+         soa(2,jn) =  319.6552
+         soa(3,jn) =  119.4471
+         soa(4,jn) =  -1.39165
+
+         sob(1,jn) =  -0.142382
+         sob(2,jn) =   0.091459
+         sob(3,jn) =  -0.0157274
+
+         ! Schmidt number 
+         sca(1,jn) = 3579.2
+         sca(2,jn) = -222.63
+         sca(3,jn) = 7.5749
+         sca(4,jn) = -0.14595
+         sca(5,jn) = 0.0011874
+
+         ! atm. concentration
+         atm_cfc(:,:,jn) = p_cfc(:,:,1)
+      endif
 
       ! coefficient for CFC12 
       !----------------------
-
-      ! Solubility
-      soa(1,2) = -218.0971
-      soa(2,2) =  298.9702
-      soa(3,2) =  113.8049
-      soa(4,2) =  -1.39165
-
-      sob(1,2) =  -0.143566
-      sob(2,2) =   0.091015
-      sob(3,2) =  -0.0153924
-
-      ! schmidt number 
-      sca(1,2) =  3845.4 
-      sca(2,2) =  -228.95
-      sca(3,2) =  6.1908 
-      sca(4,2) =  -0.067430
+      if ( lp_cfc12 ) then
+         jn = jn + 1
+         ! Solubility
+         soa(1,jn) = -218.0971
+         soa(2,jn) =  298.9702
+         soa(3,jn) =  113.8049
+         soa(4,jn) =  -1.39165
+
+         sob(1,jn) =  -0.143566
+         sob(2,jn) =   0.091015
+         sob(3,jn) =  -0.0153924
+
+         ! schmidt number 
+         sca(1,jn) = 3828.1
+         sca(2,jn) = -249.86
+         sca(3,jn) = 8.7603
+         sca(4,jn) = -0.1716
+         sca(5,jn) = 0.001408
+
+         ! atm. concentration
+         atm_cfc(:,:,jn) = p_cfc(:,:,2)
+      endif
+
+      ! coefficient for SF6
+      !----------------------
+      if ( lp_sf6 ) then
+         jn = jn + 1
+         ! Solubility
+         soa(1,jn) = -80.0343
+         soa(2,jn) = 117.232
+         soa(3,jn) =  29.5817
+         soa(4,jn) =   0.0
+
+         sob(1,jn) =  0.0335183 
+         sob(2,jn) = -0.0373942 
+         sob(3,jn) =  0.00774862
+
+         ! schmidt number
+         sca(1,jn) = 3177.5
+         sca(2,jn) = -200.57
+         sca(3,jn) = 6.8865
+         sca(4,jn) = -0.13335
+         sca(5,jn) = 0.0010877
+  
+         ! atm. concentration
+         atm_cfc(:,:,jn) = p_cfc(:,:,3)
+       endif
 
       IF( ln_rsttr ) THEN
@@ -272,7 +327,8 @@
       !!                     ***  ROUTINE trc_sms_cfc_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( xphem   (jpi,jpj)        ,     &
-         &      qtr_cfc (jpi,jpj,jp_cfc) ,     &
-         &      qint_cfc(jpi,jpj,jp_cfc) , STAT=trc_sms_cfc_alloc )
+      ALLOCATE( xphem   (jpi,jpj)        , atm_cfc(jpyear,jphem,jp_cfc)  ,    &
+         &      qtr_cfc (jpi,jpj,jp_cfc) , qint_cfc(jpi,jpj,jp_cfc)      ,    &
+         &      soa(4,jp_cfc)    ,  sob(3,jp_cfc)   ,  sca(5,jp_cfc)     ,    &
+         &      STAT=trc_sms_cfc_alloc )
          !
       IF( trc_sms_cfc_alloc /= 0 ) CALL ctl_warn('trc_sms_cfc_alloc : failed to allocate arrays.')
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90	(revision 10115)
@@ -15,25 +15,10 @@
    USE par_pisces , ONLY : jp_pisces_trd   !: number of biological diag in PISCES
 
-   USE par_cfc    , ONLY : jp_cfc          !: number of tracers in CFC
-   USE par_cfc    , ONLY : jp_cfc_2d       !: number of tracers in CFC
-   USE par_cfc    , ONLY : jp_cfc_3d       !: number of tracers in CFC
-   USE par_cfc    , ONLY : jp_cfc_trd      !: number of tracers in CFC
-
-   USE par_c14b   , ONLY : jp_c14b         !: number of tracers in C14
-   USE par_c14b   , ONLY : jp_c14b_2d      !: number of tracers in C14
-   USE par_c14b   , ONLY : jp_c14b_3d      !: number of tracers in C14
-   USE par_c14b   , ONLY : jp_c14b_trd     !: number of tracers in C14
-
-   USE par_age   , ONLY : jp_age         !: number of tracers in AGE
-   USE par_age   , ONLY : jp_age_2d      !: number of tracers in AGE
-   USE par_age   , ONLY : jp_age_3d      !: number of tracers in AGE
-   USE par_age   , ONLY : jp_age_trd     !: number of tracers in AGE
-
    IMPLICIT NONE
 
-   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     + jp_cfc     + jp_c14b     + jp_age      !: 
-   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d  + jp_age_2d   !:
-   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d  + jp_age_3d   !:
-   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_age_trd  !:
+   INTEGER, PARAMETER ::   jp_lm      =  jp_pisces     !: 
+   INTEGER, PARAMETER ::   jp_lm_2d   =  jp_pisces_2d  !:
+   INTEGER, PARAMETER ::   jp_lm_3d   =  jp_pisces_3d  !:
+   INTEGER, PARAMETER ::   jp_lm_trd  =  jp_pisces_trd !:
 
 #if defined key_my_trc
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcnam_my_trc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcnam_my_trc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcnam_my_trc.F90	(revision 10115)
@@ -36,10 +36,19 @@
       !!
       !!----------------------------------------------------------------------
+      INTEGER :: jn
       !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) ' trc_nam_my_trc : read MY_TRC namelists'
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~'
+      ! 
+      do jn = jp_myt0 , jp_myt1
+         ctrcnm    (jn) = 'NONAME'
+         ctrcln    (jn) = 'NO Long Name'
+         ctrcun    (jn) = 'NOUNIT'
+         ln_trc_ini(jn) = .false.
+         ln_trc_wri(jn) = .true.
+      enddo
       !
-   END SUBROUTINE trc_nam_my_trc
+      END SUBROUTINE trc_nam_my_trc
    
 #else
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 10115)
@@ -190,7 +190,12 @@
             DO ji = 1, jpi
                ! denitrification factor computed from O2 levels
-               nitrfac(ji,jj,jk) = MAX(  0.e0, 0.4 * ( 6.e-6  - trb(ji,jj,jk,jpoxy) )    &
+               nitrfac(ji,jj,jk)  = MAX(  0.e0, 0.4 * ( 6.e-6  - trb(ji,jj,jk,jpoxy) )    &
                   &                                / ( oxymin + trb(ji,jj,jk,jpoxy) )  )
-               nitrfac(ji,jj,jk) = MIN( 1., nitrfac(ji,jj,jk) )
+               nitrfac(ji,jj,jk)  = MIN( 1., nitrfac(ji,jj,jk) )
+               !
+               ! denitrification factor computed from NO3 levels
+               nitrfac2(ji,jj,jk) = MAX( 0.e0, ( 1.E-6 - trb(ji,jj,jk,jpno3) )  &
+                  &                               / ( 1.E-6 + trb(ji,jj,jk,jpno3) ) )
+               nitrfac2(ji,jj,jk) = MIN( 1., nitrfac2(ji,jj,jk) )
             END DO
          END DO
@@ -264,4 +269,5 @@
       !
       nitrfac (:,:,:) = 0._wp
+      nitrfac2(:,:,:) = 0._wp
       !
    END SUBROUTINE p4z_lim_init
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90	(revision 10115)
@@ -131,5 +131,5 @@
 
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( hi(:,:,:) )          * tmask(:,:,:) )
+         IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( MAX( rtrn, hi(:,:,:) ) )  * tmask(:,:,:) )
          IF( iom_use( "CO3"    ) ) CALL iom_put( "CO3"   , zco3(:,:,:)    * 1.e+3            * tmask(:,:,:) )
          IF( iom_use( "CO3sat" ) ) CALL iom_put( "CO3sat", zco3sat(:,:,:) * 1.e+3            * tmask(:,:,:) )
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 10115)
@@ -111,5 +111,5 @@
                !  no real reason except that it seems to be more stable and may mimic predation
                !  ---------------------------------------------------------------
-               ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes)
+               ztortz2   = mzrat2 * 1.e6 * zfact * trb(ji,jj,jk,jpmes) * (1. - nitrfac(ji,jj,jk) )
                !
                zcompadi  = MAX( ( trb(ji,jj,jk,jpdia) - xthresh2dia ), 0.e0 )
@@ -126,5 +126,6 @@
                zdenom    = zfoodlim / ( xkgraz2 + zfoodlim )
                zdenom2   = zdenom / ( zfood + rtrn )
-               zgraze2   = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpmes) 
+               zgraze2   = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpmes) * (1. - nitrfac(ji,jj,jk) )  
+ 
 
                zgrazd    = zgraze2  * xprefc   * zcompadi  * zdenom2 
@@ -142,9 +143,11 @@
 # if ! defined key_kriest
                zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk)      &
-               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes)
+               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpgoc) * trb(ji,jj,jk,jpmes) &
+               &           * (1. - nitrfac(ji,jj,jk))
                zgrazfffg = zgrazffeg * trb(ji,jj,jk,jpbfe) / (trb(ji,jj,jk,jpgoc) + rtrn)
 # endif
                zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk)     &
-               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes)
+               &           * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jppoc) * trb(ji,jj,jk,jpmes) &
+               &           * (1. - nitrfac(ji,jj,jk))
                zgrazfffp = zgrazffep * trb(ji,jj,jk,jpsfe) / (trb(ji,jj,jk,jppoc) + rtrn)
               !
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90	(revision 10115)
@@ -103,5 +103,5 @@
                !  no real reason except that it seems to be more stable and may mimic predation.
                !  ---------------------------------------------------------------
-               ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo)
+               ztortz = mzrat * 1.e6 * zfact * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk))
 
                zcompadi  = MIN( MAX( ( trb(ji,jj,jk,jpdia) - xthreshdia ), 0.e0 ), xsizedia )
@@ -115,5 +115,5 @@
                zdenom    = zfoodlim / ( xkgraz + zfoodlim )
                zdenom2   = zdenom / ( zfood + rtrn )
-               zgraze    = grazrat * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo) 
+               zgraze    = grazrat * zstep * tgfunc2(ji,jj,jk) * trb(ji,jj,jk,jpzoo) * (1. - nitrfac(ji,jj,jk)) 
 
                zgrazp    = zgraze  * xpref2p * zcompaph  * zdenom2 
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 10115)
@@ -36,5 +36,5 @@
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_par      ! structure of input par
-   INTEGER , PARAMETER :: nbtimes = 365  !: maximum number of times record in a file
+   INTEGER , PARAMETER :: nbtimes = 366  !: maximum number of times record in a file
    INTEGER  :: ntimes_par                ! number of time steps in a file
    REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: par_varsw    !: PAR fraction of shortwave
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90	(revision 10115)
@@ -67,5 +67,5 @@
       !
       INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   zremip, zremik, zsiremin 
+      REAL(wp) ::   zremip, zremik, zsiremin, zammonic 
       REAL(wp) ::   zsatur, zsatur2, znusil, znusil2, zdep, zdepmin, zfactdep
       REAL(wp) ::   zbactfer, zorem, zorem2, zofer, zolimit
@@ -78,4 +78,5 @@
       REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod, zw3d
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zoxyrem
       !!---------------------------------------------------------------------
       !
@@ -84,5 +85,5 @@
       ! Allocate temporary workspace
       CALL wrk_alloc( jpi, jpj,      ztempbac                  )
-      CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
+      CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi, zoxyrem )
 
       ! Initialisation of temprary arrys
@@ -129,9 +130,11 @@
                ! Ammonification in suboxic waters with denitrification
                ! -------------------------------------------------------
-               denitr(ji,jj,jk)  = MIN(  ( trb(ji,jj,jk,jpno3) - rtrn ) / rdenit,   &
-                  &                     zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)  )
+               zammonic = zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)
+               denitr(ji,jj,jk)  = zammonic * ( 1. - nitrfac2(ji,jj,jk) )
+               zoxyrem(ji,jj,jk) = zammonic *        nitrfac2(ji,jj,jk)
                !
                zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) )
                denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) )
+               zoxyrem(ji,jj,jk) = MAX( 0.e0, zoxyrem(ji,jj,jk) )
                !
             END DO
@@ -157,5 +160,6 @@
                tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk)
                tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr
-               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk)
+               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr &
+                  &                + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk)
             END DO
          END DO
@@ -291,11 +295,12 @@
 
       DO jk = 1, jpkm1
-         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk)
-         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk)
+         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk)
+         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk)
          tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit
-         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk)
+         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk) - zoxyrem(:,:,jk)
          tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi (:,:,jk) * o2ut
-         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk)
-         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) )
+         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk) + zoxyrem(:,:,jk)
+         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + zoxyrem(:,:,jk) &
+              &                                        + ( rdenit + 1.) * denitr(:,:,jk) )
       END DO
 
@@ -323,5 +328,5 @@
       !
       CALL wrk_dealloc( jpi, jpj,      ztempbac                  )
-      CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
+      CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi, zoxyrem )
       !
       IF( nn_timing == 1 )  CALL timing_stop('p4z_rem')
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 10115)
@@ -64,5 +64,5 @@
       REAL(wp) ::  zwflux, zfminus, zfplus
       REAL(wp) ::  zlim, zfact, zfactcal
-      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit
+      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zolimit
       REAL(wp) ::  zsiloss, zcaloss, zws3, zws4, zwsc, zdep, zwstpoc
       REAL(wp) ::  ztrfer, ztrpo4, zwdust, zlight
@@ -323,6 +323,6 @@
             tra(ji,jj,ikt,jptal) =  tra(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0
             tra(ji,jj,ikt,jpdic) =  tra(ji,jj,ikt,jpdic) + zcaloss * zrivalk
-            zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss / zdep
-            zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss / zdep
+            zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss * fse3t(ji,jj,ikt) 
+            zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss * fse3t(ji,jj,ikt) 
 #endif
          END DO
@@ -354,19 +354,19 @@
 
 #if ! defined key_sed
-            ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification
-            ! in the sediments and just above the sediments. Not very clever, but simpliest option.
-            zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 )
+            ! The 0.5 factor in zpdenit is to avoid negative NO3 concentration after
+            ! denitrification in the sediments. Not very clever, but simpliest option.
+            zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, &
+                            zdenit2d(ji,jj) * zwstpoc * zrivno3 * (1. - nitrfac2(ji,jj,ikt) ) )
             z1pdenit = zwstpoc * zrivno3 - zpdenit
             zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) )
-            zdenitt = MIN(  0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) )
-            tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt
-            tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt
-            tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt
-            tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt)
+            tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit
+            tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit
+            tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit
+            tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * zpdenit
             tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut
-            tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) )
-            tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt
-            sdenit(ji,jj) = rdenit * zpdenit / zdep
-            zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc / zdep
+            tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * zpdenit )
+            tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit
+            sdenit(ji,jj) = rdenit * zpdenit * fse3t(ji,jj,ikt) 
+            zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc * fse3t(ji,jj,ikt) 
 #endif
          END DO
@@ -415,21 +415,23 @@
       IF( lk_iomput ) THEN
          IF( knt == nrdttrc ) THEN
-            zfact = 1.e+3 * rfact2r * rno3  !  conversion from molC/l/kt  to molN/m3/s
-            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * zfact * tmask(:,:,:) )  ! nitrogen fixation 
+            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s
+            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation 
             IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated )
                zwork1(:,:) = 0.
                DO jk = 1, jpkm1
-                 zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * zfact * fse3t(:,:,jk) * tmask(:,:,jk)
+                 zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * fse3t(:,:,jk) * tmask(:,:,jk)
                ENDDO
                CALL iom_put( "INTNFIX" , zwork1 ) 
             ENDIF
-            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * 1.e+3 )
-            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * 1.e+3 )
-            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * 1.e+3 )
-            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * 1.e+3 * rno3 )
+            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact )
+            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * zfact )
+            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * zfact )
+            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * rno3 * zfact )
          ENDIF
       ELSE
-         IF( ln_diatrc )  &
-            &  trc2d(:,:,jp_pcs0_2d + 12) = nitrpot(:,:,1) * nitrfix * rno3 * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1)
+         IF( ln_diatrc ) THEN 
+            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s
+            trc2d(:,:,jp_pcs0_2d + 12) = nitrpot(:,:,1) * nitrfix * rno3 * zfact * fse3t(:,:,1) * tmask(:,:,1)
+         ENDIF
       ENDIF
       !
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 10115)
@@ -450,11 +450,11 @@
 
       IF( kt == nittrc000 ) THEN 
+         xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr
+         xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr
+         xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s
          IF( ln_check_mass .AND. lwp) THEN      !   Open budget file of NO3, ALK, Si, Fer
             CALL ctl_opn( numco2, 'carbon.budget'  , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
             CALL ctl_opn( numnut, 'nutrient.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
             CALL ctl_opn( numnit, 'nitrogen.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
-            xfact1 = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/yr
-            xfact2 = 1.e+3 * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/s ----> TgN/m3/yr
-            xfact3 = 1.e+3 * rfact2r * rno3   ! conversion molC/l/kt ----> molN/m3/s
             cltxt='time-step   Alkalinity        Nitrate        Phosphorus         Silicate           Iron'
             IF( lwp ) WRITE(numnut,*)  TRIM(cltxt)
@@ -529,15 +529,11 @@
       IF( iom_use( "tnfix" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN
          znitrpottot  = glob_sum ( nitrpot(:,:,:) * nitrfix * cvol(:,:,:) )
-         CALL iom_put( "tnfix"  , znitrpottot * 1.e+3 * rno3 )  ! Global  nitrogen fixation molC/l  to molN/m3 
+         CALL iom_put( "tnfix"  , znitrpottot * xfact3 )  ! Global  nitrogen fixation molC/l  to molN/m3 
       ENDIF
       !
       IF( iom_use( "tdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN
-         zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) )
-         CALL iom_put( "tdenit"  , zrdenittot * 1.e+3 * rno3 )  ! Total denitrification molC/l to molN/m3 
-      ENDIF
-      !
-      IF( iom_use( "Sdenit" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN
-         zsdenittot   = glob_sum ( sdenit(:,:) * e1e2t(:,:) )
-         CALL iom_put( "Sdenit", sdenit(:,:) * xfact3 * tmask(:,:,1) )  ! Nitrate reduction in the sediments
+         zrdenittot = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) ! denitrification in the water column
+         zsdenittot = glob_sum ( sdenit(:,:) * e1e2t(:,:) * tmask(:,:,1) )              ! denitrification in the sediments
+         CALL iom_put( "tdenit"  , ( zrdenittot + zsdenittot ) * xfact3 )               ! Total denitrification in molN/m3 
       ENDIF
 
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 10115)
@@ -87,4 +87,5 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xfracal    !: ??
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac    !: ??
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac2   !: ??
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xlimbac    !: ??
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xlimbacl   !: ??
@@ -147,5 +148,6 @@
       ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk),       &
          &      xlimbac (jpi,jpj,jpk), xdiss  (jpi,jpj,jpk),       & 
-         &      xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk),     STAT=ierr(3) )
+         &      xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk),       &
+         &      nitrfac2(jpi,jpj,jpk),                           STAT=ierr(3) )
 
       !* Variable for chemistry of the CO2 cycle
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 10115)
@@ -49,5 +49,9 @@
 
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt
-
+   REAL(wp)  ::  rfact1, rfact2
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
@@ -145,16 +149,23 @@
          !                                              
       ELSE
-         ! Leap-Frog + Asselin filter time stepping
-         IF( lk_vvl ) THEN   
-
-            IF( ln_crs_top )THEN 
-               CALL tra_nxt_vvl_crs( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
-              &                                              sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl) 
-            ELSE
-               CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
-              &                                          sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl) 
+         IF( .NOT. lk_offline ) THEN ! Leap-Frog + Asselin filter time stepping
+
+            IF( lk_vvl ) THEN   
+               IF( ln_crs_top )THEN 
+                  CALL tra_nxt_vvl_crs( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
+                 &                                              sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl) 
+               ELSE
+                  CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
+                 &                                          sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl) 
+               ENDIF
+            ELSE                   
+               CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level 
             ENDIF
-         ELSE                   ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level 
+
+         ELSE
+                                    CALL trc_nxt_off( kt )       ! offline
          ENDIF
+
+
       ENDIF
 
@@ -181,4 +192,80 @@
    END SUBROUTINE trc_nxt
 
+   SUBROUTINE trc_nxt_off( kt )
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE tra_nxt_vvl  ***
+      !!
+      !! ** Purpose :   Time varying volume: apply the Asselin time filter  
+      !!                and swap the tracer fields.
+      !! 
+      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields.
+      !!              - save in (ta,sa) a thickness weighted average over the three 
+      !!             time levels which will be used to compute rdn and thus the semi-
+      !!             implicit hydrostatic pressure gradient (ln_dynhpg_imp = T)
+      !!              - swap tracer fields to prepare the next time_step.
+      !!                This can be summurized for tempearture as:
+      !!             ztm = ( e3t_n*tn + rbcp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )   ln_dynhpg_imp = T
+      !!                  /( e3t_n    + rbcp*[ e3t_b    - 2 e3t_n    + e3t_a    ] )   
+      !!             ztm = 0                                                       otherwise
+      !!             tb  = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )
+      !!                  /( e3t_n    + atfp*[ e3t_b    - 2 e3t_n    + e3t_a    ] )
+      !!             tn  = ta 
+      !!             ta  = zt        (NB: reset to 0 after eos_bn2 call)
+      !!
+      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step
+      !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T)
+      !!----------------------------------------------------------------------
+      INTEGER         , INTENT(in   )                               ::  kt       ! ocean time-step index
+      !!     
+      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
+      REAL(wp) ::   ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
+      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      -
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == nittrc000 )  THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'trc_nxt_off : time stepping'
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         IF( lk_vvl ) THEN
+           rfact1 = atfp * rdttrc(1)
+           rfact2 = rfact1 / rau0
+         ENDIF
+      ENDIF
+      !
+      DO jn = 1, jptra
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ze3t_b = fse3t_b(ji,jj,jk)
+                  ze3t_n = fse3t_n(ji,jj,jk)
+                  ze3t_a = fse3t_a(ji,jj,jk)
+                  !                                         ! tracer content at Before, now and after
+                  ztc_b  = trb(ji,jj,jk,jn) * ze3t_b
+                  ztc_n  = trn(ji,jj,jk,jn) * ze3t_n
+                  ztc_a  = tra(ji,jj,jk,jn) * ze3t_a
+                  !
+                  ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b
+                  ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
+                  !
+                  ze3t_f = ze3t_n + atfp * ze3t_d
+                  ztc_f  = ztc_n  + atfp * ztc_d
+                  !
+                  IF( lk_vvl .AND. jk == mikt(ji,jj) ) THEN           ! first level 
+                     ze3t_f = ze3t_f - rfact2 * ( emp_b(ji,jj)      - emp(ji,jj)   )
+                     ztc_f  = ztc_f  - rfact1 * ( sbc_trc(ji,jj,jn) - sbc_trc_b(ji,jj,jn) )
+                  ENDIF
+
+                  ze3t_f = 1.e0 / ze3t_f
+                  trb(ji,jj,jk,jn) = ztc_f * ze3t_f       ! ptb <-- ptn filtered
+                  trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)     ! ptn <-- pta
+                  !
+               END DO
+            END DO
+         END DO
+         ! 
+      END DO
+      !
+   END SUBROUTINE trc_nxt_off
+
 #else
    !!----------------------------------------------------------------------
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 10115)
@@ -22,5 +22,5 @@
    PRIVATE
 
-   PUBLIC trc_rad         ! routine called by trcstp.F90
+   PUBLIC trc_rad, trc_rad_sms        ! routine called by trcstp.F90
 
    !! * Substitutions
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 10115)
@@ -12,4 +12,5 @@
    USE dom_oce    , ONLY : gdepw_1d
    USE dom_oce    , ONLY : rdttra
+   USE dom_oce    , ONLY : atfp
    USE dom_oce    , ONLY : Agrif_Root      => Agrif_Root
    USE sbc_oce    , ONLY : nn_ice_embd
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcbc.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcbc.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcbc.F90	(revision 10115)
@@ -277,5 +277,5 @@
       ! OPEN boundary conditions: DOES NOT WORK. Waiting for stable BDY
       IF( nb_trcobc > 0 ) THEN
-        if (lwp) write(numout,'(a,i5,a,i5)') '   reading OBC data for ', nb_trcobc ,' variables at step ', kt
+        if (lwp) write(numout,'(a,i5,a,i12)') '   reading OBC data for ', nb_trcobc ,' variables at step ', kt
         CALL fld_read(kt,1,sf_trcobc)
         ! vertical interpolation on s-grid and partial step to be added
@@ -284,5 +284,5 @@
       ! SURFACE boundary conditions       
       IF( nb_trcsbc > 0 ) THEN
-        if (lwp) write(numout,'(a,i5,a,i5)') '   reading SBC data for ', nb_trcsbc ,' variables at step ', kt
+        if (lwp) write(numout,'(a,i5,a,i12)') '   reading SBC data for ', nb_trcsbc ,' variables at step ', kt
         CALL fld_read(kt,1,sf_trcsbc)
       ENDIF
@@ -290,5 +290,5 @@
       ! COASTAL boundary conditions       
       IF( nb_trccbc > 0 ) THEN
-        if (lwp) write(numout,'(a,i5,a,i5)') '   reading CBC data for ', nb_trccbc ,' variables at step ', kt
+        if (lwp) write(numout,'(a,i5,a,i12)') '   reading CBC data for ', nb_trccbc ,' variables at step ', kt
         CALL fld_read(kt,1,sf_trccbc)
       ENDIF   
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 10115)
@@ -200,5 +200,5 @@
                DO ji = 1, jpi
                   DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points
-                     zl = fsdept_n(ji,jj,jk)
+                     zl = gdept_0(ji,jj,jk)
                      IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data
                         ztp(jk) = ztrcdta(ji,jj,1)
@@ -229,10 +229,10 @@
                      ik = mbkt(ji,jj) 
                      IF( ik > 1 ) THEN
-                        zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
+                        zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
                         ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik-1)
                      ENDIF
                      ik = mikt(ji,jj)
                      IF( ik > 1 ) THEN
-                        zl = ( fsdept_n(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
+                        zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
                         ztrcdta(ji,jj,ik) = (1.-zl) * ztrcdta(ji,jj,ik) + zl * ztrcdta(ji,jj,ik+1)
                      ENDIF
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcice.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcice.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcice.F90	(revision 10115)
@@ -52,7 +52,7 @@
       IF ( nn_ice_tr == 1 ) THEN
          IF( lk_pisces  )    CALL trc_ice_ini_pisces       ! PISCES  bio-model
+         IF( lk_my_trc  )    CALL trc_ice_ini_my_trc       ! MY_TRC  tracers
          IF( lk_cfc     )    CALL trc_ice_ini_cfc          ! CFC     tracers
          IF( lk_c14b    )    CALL trc_ice_ini_c14b         ! C14 bomb  tracer
-         IF( lk_my_trc  )    CALL trc_ice_ini_my_trc       ! MY_TRC  tracers
       ENDIF
 
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 10115)
@@ -99,8 +99,8 @@
 
       IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model
+      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC    tracers
       IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC       tracers
       IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer
       IF( lk_age     )       CALL trc_ini_age          ! AGE       tracer
-      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC    tracers
 
       CALL trc_ice_ini                                 ! Tracers in sea ice
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 10115)
@@ -79,4 +79,30 @@
       ENDIF
 
+      ! Call the ice module for tracers
+      ! -------------------------------
+      CALL trc_nam_ice
+
+      ! namelist of SMS
+      ! ---------------
+      IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model
+      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
+      ENDIF
+
+      IF( lk_my_trc  ) THEN  ;   CALL trc_nam_my_trc       ! MY_TRC  tracers
+      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          MY_TRC not used'
+      ENDIF
+
+      IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers
+      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
+      ENDIF
+
+      IF( lk_c14b    ) THEN  ;   CALL trc_nam_c14b         ! C14 bomb     tracers
+      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          C14 not used'
+      ENDIF
+
+      IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer
+      ELSE                   ;   IF(lwp) WRITE(numout,*)  '          AGE not used'
+      ENDIF
+
      IF(lwp) THEN                   ! control print
          WRITE(numout,*)
@@ -119,4 +145,215 @@
       ENDIF
 
+      !
+   END SUBROUTINE trc_nam
+
+   SUBROUTINE trc_nam_run
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_nam  ***
+      !!
+      !! ** Purpose :   read options for the passive tracer run (namelist) 
+      !!
+      !!---------------------------------------------------------------------
+      NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, &
+        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out
+
+
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+
+      !!---------------------------------------------------------------------
+
+
+      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 )
+
+      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
+      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
+
+      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
+      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
+      IF(lwm) WRITE ( numont, namtrc_run )
+
+      !  computes the first time step of tracer model
+      nittrc000 = nit000 + nn_dttrc - 1
+
+      IF(lwp) THEN                   ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist : namtrc_run'
+         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc
+         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr
+         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr
+         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000
+         WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc 
+         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
+         WRITE(numout,*) ' '
+      ENDIF
+      !
+    END SUBROUTINE trc_nam_run
+
+   SUBROUTINE trc_nam_ice
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_nam_ice ***
+      !!
+      !! ** Purpose :   Read the namelist for the ice effect on tracers
+      !!
+      !! ** Method  : -
+      !!
+      !!---------------------------------------------------------------------
+      ! --- Variable declarations --- !
+      INTEGER :: jn      ! dummy loop indices
+      INTEGER :: ios     ! Local integer output status for namelist read
+
+      ! --- Namelist declarations --- !
+      TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer
+      NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice'
+         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
+      ENDIF
+
+      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice')
+
+      !
+      REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data
+      READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901)
+ 901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp )
+
+      REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients
+      READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 )
+ 902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp )
+
+      IF( lwp ) THEN
+         WRITE(numout,*) ' '
+         WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr
+         WRITE(numout,*) ' '
+      ENDIF
+
+      ! Assign namelist stuff
+      DO jn = 1, jptra
+         trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio
+         trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr
+         cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o
+      END DO
+
+      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice')
+      !
+   END SUBROUTINE trc_nam_ice
+
+   SUBROUTINE trc_nam_trc
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_nam  ***
+      !!
+      !! ** Purpose :   read options for the passive tracer run (namelist) 
+      !!
+      !!---------------------------------------------------------------------
+      TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput
+      !!
+      NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo
+  
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      INTEGER  ::   jn                  ! dummy loop indice
+      !!---------------------------------------------------------------------
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+
+      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
+      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
+
+      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
+      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
+      IF(lwm) WRITE ( numont, namtrc )
+
+      DO jn = 1, jptra
+         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname )
+         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname )
+         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  )
+         ln_trc_ini(jn) =       sn_tracer(jn)%llinit
+         ln_trc_wri(jn) =       sn_tracer(jn)%llsave
+      END DO
+      
+    END SUBROUTINE trc_nam_trc
+
+
+   SUBROUTINE trc_nam_dia
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_nam_dia  ***
+      !!
+      !! ** Purpose :   read options for the passive tracer diagnostics
+      !!
+      !! ** Method  : - read passive tracer namelist 
+      !!              - read namelist of each defined SMS model
+      !!                ( (PISCES, CFC, MY_TRC )
+      !!---------------------------------------------------------------------
+      INTEGER ::  ierr
+#if defined key_trdmxl_trc  || defined key_trdtrc
+      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
+         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, &
+         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc
+#endif
+      NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio
+
+      INTEGER  ::   jn        
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      !!---------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*) 
+      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics
+      READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903)
+903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp )
+
+      REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics
+      READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 )
+904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp )
+      IF(lwm) WRITE ( numont, namtrc_dia )
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist : namtrc_dia'
+         WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc
+         WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio
+         WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia
+         WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio
+         WRITE(numout,*) ' '
+      ENDIF
+
+      IF( ln_diatrc ) THEN 
+         ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  &
+           &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  & 
+           &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr ) 
+         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' )
+         !
+         trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' ' 
+         trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' ' 
+         !
+      ENDIF
+
+      IF( ln_diabio .OR. l_trdtrc ) THEN
+         ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , &
+           &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) 
+         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' )
+         !
+         trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' ' 
+         !
+      ENDIF
 
 #if defined key_trdmxl_trc || defined key_trdtrc
@@ -146,241 +383,4 @@
          ENDIF
 #endif
-
-
-      ! Call the ice module for tracers
-      ! -------------------------------
-      CALL trc_nam_ice
-
-      ! namelist of SMS
-      ! ---------------      
-      IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
-      ENDIF
-
-      IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
-      ENDIF
-
-      IF( lk_c14b    ) THEN  ;   CALL trc_nam_c14b         ! C14 bomb     tracers
-      ELSE                   ;   IF(lwp) WRITE(numout,*) '          C14 not used'
-      ENDIF
-
-      IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer
-      ELSE                   ;   IF(lwp) WRITE(numout,*) '          AGE not used'
-      ENDIF
-
-      IF( lk_my_trc  ) THEN  ;   CALL trc_nam_my_trc      ! MY_TRC  tracers
-      ELSE                   ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
-      ENDIF
-      !
-   END SUBROUTINE trc_nam
-
-   SUBROUTINE trc_nam_run
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_nam  ***
-      !!
-      !! ** Purpose :   read options for the passive tracer run (namelist) 
-      !!
-      !!---------------------------------------------------------------------
-      NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, &
-        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out
-
-
-      INTEGER  ::   ios                 ! Local integer output status for namelist read
-
-      !!---------------------------------------------------------------------
-
-
-      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 )
-
-      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
-      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
-      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
-      IF(lwm) WRITE ( numont, namtrc_run )
-
-      !  computes the first time step of tracer model
-      nittrc000 = nit000 + nn_dttrc - 1
-
-      IF(lwp) THEN                   ! control print
-         WRITE(numout,*)
-         WRITE(numout,*) ' Namelist : namtrc_run'
-         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc
-         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr
-         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr
-         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000
-         WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc 
-         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
-         WRITE(numout,*) ' '
-      ENDIF
-      !
-    END SUBROUTINE trc_nam_run
-
-   SUBROUTINE trc_nam_ice
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_nam_ice ***
-      !!
-      !! ** Purpose :   Read the namelist for the ice effect on tracers
-      !!
-      !! ** Method  : -
-      !!
-      !!---------------------------------------------------------------------
-      ! --- Variable declarations --- !
-      INTEGER :: jn      ! dummy loop indices
-      INTEGER :: ios     ! Local integer output status for namelist read
-
-      ! --- Namelist declarations --- !
-      TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer
-      NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer
-
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice'
-         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-      ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice')
-
-      !
-      REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data
-      READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901)
- 901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients
-      READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 )
- 902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp )
-
-      IF( lwp ) THEN
-         WRITE(numout,*) ' '
-         WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr
-         WRITE(numout,*) ' '
-      ENDIF
-
-      ! Assign namelist stuff
-      DO jn = 1, jptra
-         trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio
-         trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr
-         cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o
-      END DO
-
-      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice')
-      !
-   END SUBROUTINE trc_nam_ice
-
-   SUBROUTINE trc_nam_trc
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_nam  ***
-      !!
-      !! ** Purpose :   read options for the passive tracer run (namelist) 
-      !!
-      !!---------------------------------------------------------------------
-      TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput
-      !!
-      NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo
-  
-      INTEGER  ::   ios                 ! Local integer output status for namelist read
-      INTEGER  ::   jn                  ! dummy loop indice
-      !!---------------------------------------------------------------------
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-
-      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
-      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
-      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
-      IF(lwm) WRITE ( numont, namtrc )
-
-      DO jn = 1, jptra
-         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname )
-         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname )
-         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  )
-         ln_trc_ini(jn) =       sn_tracer(jn)%llinit
-         ln_trc_wri(jn) =       sn_tracer(jn)%llsave
-      END DO
-      
-    END SUBROUTINE trc_nam_trc
-
-
-   SUBROUTINE trc_nam_dia
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_nam_dia  ***
-      !!
-      !! ** Purpose :   read options for the passive tracer diagnostics
-      !!
-      !! ** Method  : - read passive tracer namelist 
-      !!              - read namelist of each defined SMS model
-      !!                ( (PISCES, CFC, MY_TRC )
-      !!---------------------------------------------------------------------
-      INTEGER ::  ierr
-#if defined key_trdmxl_trc  || defined key_trdtrc
-      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
-         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, &
-         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc
-#endif
-      NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio
-
-      INTEGER  ::   ios                 ! Local integer output status for namelist read
-      !!---------------------------------------------------------------------
-
-      IF(lwp) WRITE(numout,*) 
-      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-      REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics
-      READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903)
-903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics
-      READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 )
-904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp )
-      IF(lwm) WRITE ( numont, namtrc_dia )
-
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*)
-         WRITE(numout,*) ' Namelist : namtrc_dia'
-         WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc
-         WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio
-         WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia
-         WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio
-         WRITE(numout,*) ' '
-      ENDIF
-
-      IF( ln_diatrc ) THEN 
-         ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  &
-           &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  & 
-           &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr ) 
-         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' )
-         !
-         trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' ' 
-         trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' ' 
-         !
-      ENDIF
-
-      IF( ln_diabio .OR. l_trdtrc ) THEN
-         ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , &
-           &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) 
-         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' )
-         !
-         trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' ' 
-         !
-      ENDIF
       !
    END SUBROUTINE trc_nam_dia
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 10115)
@@ -50,8 +50,8 @@
       !
       IF( lk_pisces  )   CALL trc_sms_pisces ( kt )    ! main program of PISCES 
+      IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers
       IF( lk_cfc     )   CALL trc_sms_cfc    ( kt )    ! surface fluxes of CFC
       IF( lk_c14b    )   CALL trc_sms_c14b   ( kt )    ! surface fluxes of C14
       IF( lk_age     )   CALL trc_sms_age    ( kt )    ! AGE tracer
-      IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers
 
       IF(ln_ctl) THEN      ! print mean trends (used for debugging)
Index: NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
===================================================================
--- NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 10106)
+++ NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 10115)
@@ -58,8 +58,8 @@
       ! ---------------------------------------
       IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES 
+      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
       IF( lk_cfc     )   CALL trc_wri_cfc        ! surface fluxes of CFC
       IF( lk_c14b    )   CALL trc_wri_c14b       ! surface fluxes of C14
       IF( lk_age     )   CALL trc_wri_age        ! AGE tracer
-      IF( lk_my_trc  )   CALL trc_wri_my_trc     ! MY_TRC  tracers
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
