Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90	(revision 6715)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/par_age.F90	(revision 6715)
@@ -0,0 +1,69 @@
+MODULE par_age
+   !!======================================================================
+   !!                        ***  par_age  ***
+   !! TOP :   set the AGE parameters
+   !!======================================================================
+   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec)  revised architecture
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+   USE par_pisces , ONLY : jp_pisces       !: number of tracers in PISCES
+   USE par_pisces , ONLY : jp_pisces_2d    !: number of 2D diag in PISCES
+   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_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
+
+   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 !:
+
+#if defined key_age
+   !!---------------------------------------------------------------------
+   !!   'key_age'                     user defined tracers (AGE)
+   !!---------------------------------------------------------------------
+   LOGICAL, PUBLIC, PARAMETER ::   lk_age     = .TRUE.   !: PTS flag 
+   INTEGER, PUBLIC, PARAMETER ::   jp_age     =  1       !: number of PTS tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_2d  =  0       !: additional 2d output arrays ('key_trc_diaadd')
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_3d  =  0       !: additional 3d output arrays ('key_trc_diaadd')
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_trd =  0       !: number of sms trends for AGE
+
+   ! assign an index in trc arrays for each PTS prognostic variables
+   INTEGER, PUBLIC, PARAMETER ::   jpage1 = jp_lm + 1     !: 1st AGE tracer
+
+#else
+   !!---------------------------------------------------------------------
+   !!   Default                           No user defined tracers (AGE)
+   !!---------------------------------------------------------------------
+   LOGICAL, PUBLIC, PARAMETER ::   lk_age     = .FALSE.  !: AGE flag 
+   INTEGER, PUBLIC, PARAMETER ::   jp_age     =  0       !: No AGE tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_2d  =  0       !: No AGE additional 2d output arrays 
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_3d  =  0       !: No AGE additional 3d output arrays 
+   INTEGER, PUBLIC, PARAMETER ::   jp_age_trd =  0       !: number of sms trends for AGE
+#endif
+
+   ! Starting/ending PISCES do-loop indices (N.B. no PISCES : jpl_pcs < jpf_pcs the do-loop are never done)
+   INTEGER, PUBLIC, PARAMETER ::   jp_age0     = jp_lm     + 1              !: First index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age1     = jp_lm     + jp_age      !: Last  index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age0_2d  = jp_lm_2d  + 1              !: First index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age1_2d  = jp_lm_2d  + jp_age_2d   !: Last  index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age0_3d  = jp_lm_3d  + 1              !: First index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age1_3d  = jp_lm_3d  + jp_age_3d   !: Last  index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age0_trd = jp_lm_trd + 1              !: First index of AGE passive tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_age1_trd = jp_lm_trd + jp_age_trd  !: Last  index of AGE passive tracers
+
+   !!======================================================================
+END MODULE par_age
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcini_age.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcini_age.F90	(revision 6715)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcini_age.F90	(revision 6715)
@@ -0,0 +1,71 @@
+MODULE trcini_age
+   !!======================================================================
+   !!                         ***  MODULE trcini_age  ***
+   !! TOP :   initialisation of the AGE tracer
+   !!======================================================================
+   !! History :   2.0  !  2007-12  (G. Nurser, G. Madec, C. Ethe ) Original code
+   !!----------------------------------------------------------------------
+#if defined key_age
+   !!----------------------------------------------------------------------
+   !!   'key_age'                                               AGE tracer
+   !!----------------------------------------------------------------------
+   !! trc_ini_age   : MY_TRC model initialisation
+   !!----------------------------------------------------------------------
+   USE oce_trc
+   USE trc
+   USE trcsms_age
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   trc_ini_age   ! called by trcini.F90 module
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE trc_ini_age
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_ini_age  ***  
+      !!
+      !! ** Purpose :   initialization for AGE model
+      !!
+      !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_ini_age: passive tracer age'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
+
+      rryear  = 1._wp / ( nyear_len(1) * rday )    ! recip number of seconds in one year
+
+      !! BUG in s-coordinate this does not work!
+      nlb_age = MINLOC( gdepw_1d, mask = gdepw_1d > rn_age_depth, dim = 1 ) ! shallowest W level Below age_depth
+                                                                            !  = shallowest T level wholly below age_depth
+
+      nl_age  = nlb_age - 1                                                 ! deepest    W level Above age_depth
+                                                                            !  = T level surrounding age_depth
+
+      nla_age = nl_age - 1                                                   ! deepest    T level wholly above age_depth
+
+      frac_kill_age = ( rn_age_depth - gdepw_1d(nl_age) ) / e3t_1d(nl_age)      ! fraction of level nl_age above age_depth
+      frac_add_age  = 1._wp -  frac_kill_age                                    ! fraction of level nl_age below age_depth
+
+      
+      IF( .NOT. ln_rsttr ) trn(:,:,:,jp_age0:jp_age1) = 0.
+      !
+   END SUBROUTINE trc_ini_age
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                        No AGE model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_ini_age             ! Empty routine
+   END SUBROUTINE trc_ini_age
+#endif
+
+   !!======================================================================
+END MODULE trcini_age
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90	(revision 6715)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcnam_age.F90	(revision 6715)
@@ -0,0 +1,82 @@
+MODULE trcnam_age
+   !!======================================================================
+   !!                         ***  MODULE trcnam_age  ***
+   !! TOP :   initialisation of some run parameters for Age tracer
+   !!======================================================================
+   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) 
+   !!----------------------------------------------------------------------
+#if defined key_age
+   !!----------------------------------------------------------------------
+   !!   'key_age'                                               AGE tracers
+   !!----------------------------------------------------------------------
+   !! trc_nam_age      : AGE  tracer initialisation
+   !!----------------------------------------------------------------------
+   USE oce_trc         ! Ocean variables
+   USE trcsms_age      ! AGE specific variable
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   trc_nam_age   ! called by trcnam.F90 module
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_nam_age
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_nam_age  ***
+      !!                 
+      !! ** Purpose :   Definition some run parameter for AGE model
+      !!
+      !! ** input   :   Namelist namage
+      !!----------------------------------------------------------------------
+      INTEGER ::  numnatg_ref = -1   ! Logical unit for reference AGE namelist
+      INTEGER ::  numnatg_cfg = -1   ! Logical unit for configuration AGE namelist
+      INTEGER ::  numong      = -1   ! Logical unit for output namelist
+      INTEGER :: ios                 ! Local integer output status for namelist read
+      INTEGER :: jl, jn
+      !!
+      NAMELIST/namage/ rn_age_depth, rn_age_kill_rate 
+      !!----------------------------------------------------------------------
+      !                             ! Open namelist files
+      CALL ctl_opn( numnatg_ref, 'namelist_age_ref'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      CALL ctl_opn( numnatg_cfg, 'namelist_age_cfg'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      IF(lwm) CALL ctl_opn( numong, 'output.namelist.age', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+
+      REWIND( numnatg_ref )              ! Namelist namagedate in reference namelist : AGE parameters
+      READ  ( numnatg_ref, namage, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namage in reference namelist', lwp )
+
+      REWIND( numnatg_cfg )              ! Namelist namagedate in configuration namelist : AGE parameters
+      READ  ( numnatg_cfg, namage, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namage in configuration namelist', lwp )
+      IF(lwm) WRITE ( numong, namage )
+
+      IF(lwp) THEN                  ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) ' trc_nam_age: Read namage, namelist for Age passive tracer'
+         WRITE(numout,*) ' ~~~~~~~'
+         WRITE(numout,*) '  depth over which age tracer reset to zero                              rn_age_depth      = ', rn_age_depth 
+         WRITE(numout,*) '  recip of relax. timescale (s) for age tracer shallower than age_depth  rn_age_kill_rate  = ', rn_age_kill_rate 
+      ENDIF
+
+      IF(lwm) CALL FLUSH ( numong )     ! flush output namelist
+
+   END SUBROUTINE trc_nam_age
+   
+#else
+   !!----------------------------------------------------------------------
+   !!  Dummy module :                                                No AGE
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_nam_age                      ! Empty routine
+   END  SUBROUTINE  trc_nam_age
+#endif  
+
+   !!======================================================================
+END MODULE trcnam_age
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90	(revision 6715)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcsms_age.F90	(revision 6715)
@@ -0,0 +1,100 @@
+MODULE trcsms_age
+   !!======================================================================
+   !!                         ***  MODULE trcsms_age  ***
+   !! TOP :   Main module of the AGE tracers
+   !!======================================================================
+   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) Original code
+   !!----------------------------------------------------------------------
+#if defined key_age
+   !!----------------------------------------------------------------------
+   !!   'key_age'                                               AGE tracer
+   !!----------------------------------------------------------------------
+   !! trc_sms_age       : AGE model main routine
+   !!----------------------------------------------------------------------
+   USE oce_trc         ! Ocean variables
+   USE trc             ! TOP variables
+   USE trd_oce
+   USE trdtrc
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   trc_sms_age       ! called by trcsms.F90 module
+
+   INTEGER , PUBLIC :: nl_age             ! T level surrounding age_depth
+   INTEGER , PUBLIC :: nla_age            ! T level wholly above age_depth
+   INTEGER , PUBLIC :: nlb_age            ! T level wholly below age_depth
+
+   REAL(wp), PUBLIC :: rn_age_depth       ! = 10       depth over which age tracer reset to zero
+   REAL(wp), PUBLIC :: rn_age_kill_rate   ! = -1./7200  recip of relaxation timescale (s) for  age tracer shallower than age_depth
+   
+   REAL(wp), PUBLIC :: rryear          !: recip number of seconds in one year
+   REAL(wp), PUBLIC :: frac_kill_age   !: fraction of level nl_age above age_depth where it is relaxed towards zero
+   REAL(wp), PUBLIC :: frac_add_age    !: fraction of level nl_age below age_depth where it is incremented
+
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE trc_sms_age( kt )
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_sms_age  ***
+      !!
+      !! ** Purpose :   main routine of AGE model
+      !!
+      !! ** Method  : -
+      !!----------------------------------------------------------------------
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      INTEGER ::   jn, jk   ! dummy loop index
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrage
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('trc_sms_age')
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_sms_age:  AGE model'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
+
+      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrage )
+
+      DO jk = 1, nla_age
+         tra(:,:,jk,jpage1) = rn_age_kill_rate * trb(:,:,jk,jpage1)
+      ENDDO
+      !
+      tra(:,:,nl_age,jpage1) = frac_kill_age * rn_age_kill_rate * trb(:,:,nl_age,jpage1)  &
+          &                  + frac_add_age  * rryear * tmask(:,:,nl_age)
+      !
+      DO jk = nlb_age, jpk
+         tra(:,:,jk,jpage1) = tmask(:,:,jk) * rryear
+      ENDDO
+      !
+      IF( l_trdtrc ) THEN      ! Save the trends in the mixed layer
+          DO jn = jp_age0, jp_age1
+            ztrage(:,:,:) = tra(:,:,:,jn)
+            CALL trd_trc( ztrage, jn, jptra_sms, kt )   ! save trends
+          END DO
+          CALL wrk_dealloc( jpi, jpj, jpk, ztrage )
+      END IF
+      !
+      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_age')
+      !
+   END SUBROUTINE trc_sms_age
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                        No AGE model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_sms_age( kt )             ! Empty routine
+      INTEGER, INTENT( in ) ::   kt
+      WRITE(*,*) 'trc_sms_age: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_sms_age
+#endif
+
+   !!======================================================================
+END MODULE trcsms_age
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90	(revision 6715)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/AGE/trcwri_age.F90	(revision 6715)
@@ -0,0 +1,62 @@
+MODULE trcwri_age
+   !!======================================================================
+   !!                       *** MODULE trcwri ***
+   !!    age :   Output of age tracers
+   !!======================================================================
+   !! History :   1.0  !  2009-05 (C. Ethe)  Original code
+   !!----------------------------------------------------------------------
+#if defined key_top && defined key_age && defined key_iomput
+   !!----------------------------------------------------------------------
+   !!   'key_age'                                           age model
+   !!----------------------------------------------------------------------
+   !! trc_wri_age   :  outputs of concentration fields
+   !!----------------------------------------------------------------------
+   USE par_age     
+   USE trc         
+   USE iom
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC trc_wri_age 
+
+#  include "top_substitute.h90"
+CONTAINS
+
+   SUBROUTINE trc_wri_age
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_wri_trc  ***
+      !!
+      !! ** Purpose :   output passive tracers fields 
+      !!---------------------------------------------------------------------
+      CHARACTER (len=20)   :: cltra
+      INTEGER              :: jn
+      !!---------------------------------------------------------------------
+
+ 
+      ! write the tracer concentrations in the file
+      ! ---------------------------------------
+      DO jn = jp_age0, jp_age1
+         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer
+         CALL iom_put( TRIM(cltra), trn(:,:,:,jn) )
+      END DO
+      !
+      !
+   END SUBROUTINE trc_wri_age
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Dummy module :                                     No passive tracer
+   !!----------------------------------------------------------------------
+   PUBLIC trc_wri_age
+CONTAINS
+   SUBROUTINE trc_wri_age                     ! Empty routine  
+   END SUBROUTINE trc_wri_age
+#endif
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!======================================================================
+END MODULE trcwri_age
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 6715)
@@ -49,5 +49,5 @@
       TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d
       !!
-      NAMELIST/namcfcdate/ ndate_beg, nyear_res
+      NAMELIST/namcfcdate/ ndate_beg, nyear_res, simu_type 
       NAMELIST/namcfcdia/  cfcdia2d     ! additional diagnostics
       !!----------------------------------------------------------------------
@@ -72,4 +72,9 @@
          WRITE(numout,*) '    initial calendar date (aammjj) for CFC  ndate_beg = ', ndate_beg
          WRITE(numout,*) '    restoring time constant (year)          nyear_res = ', nyear_res
+         IF (simu_type==1) THEN
+            WRITE(numout,*) ' CFC running on SPIN-UP mode             simu_type = ', simu_type
+         ELSEIF (simu_type==2) THEN
+            WRITE(numout,*) ' CFC running on HINDCAST/PROJECTION mode simu_type = ', simu_type
+         ENDIF
       ENDIF
       nyear_beg = ndate_beg / 10000
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 6715)
@@ -32,4 +32,6 @@
    INTEGER , PUBLIC            ::   jpyear         ! Number of years read in CFC1112 file
    INTEGER , PUBLIC            ::   ndate_beg      ! initial calendar date (aammjj) for CFC
+   INTEGER , PUBLIC            ::   simu_type      ! Kind of simulation: 1- Spin-up 
+                                                   !                     2- Hindcast/projection
    INTEGER , PUBLIC            ::   nyear_res      ! restoring time constant (year)
    INTEGER , PUBLIC            ::   nyear_beg      ! initial year (aa) 
@@ -80,5 +82,5 @@
       !
       INTEGER  ::   ji, jj, jn, jl, jm, js
-      INTEGER  ::   iyear_beg, iyear_end
+      INTEGER  ::   iyear_beg, iyear_end,iyear_tmp
       INTEGER  ::   im1, im2, ierr
       REAL(wp) ::   ztap, zdtap        
@@ -104,5 +106,41 @@
       ! Temporal interpolation
       ! ----------------------
-      iyear_beg = nyear - 1900
+      !! JPALM -- 15-06-2016 -- define 2 kind of CFC run.
+      !!                     we want to make cycle experiments, 
+      !!                     to periodically compare the ocean dynamic within
+      !!                     1- the SPIN-UP and 2- Hincast/Projections
+      !!                     -- main difference is the way to define the year of
+      !!                     simulation, that determine the atm pCFC.
+      !!                     1-- Spin-up: our atm forcing is of 30y we cycle on.
+      !!                     So we do 90y CFC cycles to be in good
+      !!                     correspondance with the atmosphere
+      !!                     2-- Hindcast/proj, instead of nyear-1900 we keep
+      !!                     the 2 last digit, and enable 3 cycle from 1800 to 2100.  
+      !!----------------------------------------------------------------------
+      !! 1 -- SPIN-UP
+      IF (simu_type==1) THEN
+         iyear_tmp = nyear - nyear_res  !! JPALM -- in our spin-up, nyear_res is 1000
+         iyear_beg = MOD( iyear_tmp , 90 )
+         !! JPALM -- the pCFC file only got 78 years.
+         !!       So if iyear_beg > 78 then we set pCFC to 0
+         !!             iyear_beg = 0 as well -- must try to avoid obvious problems
+         !!             as Pcfc is set to 0.00 up to year 32, let set iyear_beg to year 10
+         !!          else, must add 30 to iyear_beg to match with P_cfc indices
+         !!---------------------------------------
+         IF ((iyear_beg > 77) .OR. (iyear_beg==0)) THEN
+            iyear_beg = 10
+         ELSE 
+            iyear_beg = iyear_beg + 30
+         ENDIF
+      !!
+      !! 2 -- Hindcast/proj
+      ELSEIF (simu_type==2) THEN
+         iyear_beg = MOD(nyear, 100)
+         IF (iyear_beg < 9)  iyear_beg = iyear_beg + 100
+         !! JPALM -- Same than previously, if iyear_beg is out of P_cfc range,
+         !!       we want to set p_CFC to 0.00 --> set iyear_beg = 10
+         IF ((iyear_beg < 30) .OR. (iyear_beg > 107)) iyear_beg = 10             
+      ENDIF
+      !!
       IF ( nmonth <= 6 ) THEN
          iyear_beg = iyear_beg - 1
@@ -246,5 +284,5 @@
       !! ** Purpose : sets constants for CFC model
       !!---------------------------------------------------------------------
-      INTEGER :: jn
+      INTEGER :: jl, jn
 
       ! coefficient for CFC11 
@@ -286,13 +324,52 @@
       sca(4,2) =  -0.067430
 
-      !IF( ln_rsttr ) THEN
-      !   IF(lwp) WRITE(numout,*)
-      !   IF(lwp) WRITE(numout,*) ' Read specific variables from CFC model '
-      !   IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
-      !   !
-      !   DO jn = jp_cfc0, jp_cfc1
-      !      CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 
-      !   END DO
-      !ENDIF
+      !!---------------------------------------------
+      !! JPALM -- re-initialize CFC fields and diags if restart a CFC cycle,
+      !!       Or if out of P_cfc range
+      IF (simu_type==1) THEN
+         iyear_tmp = nyear - nyear_res  !! JPALM -- in our spin-up, nyear_res is 1000
+         iyear_beg = MOD( iyear_tmp , 90 )
+         !!---------------------------------------
+         IF ((iyear_beg > 77) .OR. (iyear_beg==0)) THEN
+            qtr_cfc(:,:,:) = 0._wp
+            IF(lwp) THEN
+               WRITE(numout,*) 
+               WRITE(numout,*) 'restart a CFC cycle or out of P_cfc year bounds zero --'
+               WRITE(numout,*) '                          --    set qtr_CFC = 0.00   --'
+               WRITE(numout,*) '                          --   set qint_CFC = 0.00   --'
+               WRITE(numout,*) '                          --   set trn(CFC) = 0.00   --'
+            ENDIF
+            qtr_cfc(:,:,:) = 0._wp
+            qint_cfc(:,:,:) = 0._wp
+            DO jl = 1, jp_cfc
+              jn = jp_cfc0 + jl - 1
+              trn(:,:,:,jn) = 0._wp
+              trb(:,:,:,jn) = 0._wp
+            END DO
+         ENDIF
+      !!
+      !! 2 -- Hindcast/proj
+      ELSEIF (simu_type==2) THEN
+         iyear_beg = MOD(nyear, 100)
+         IF (iyear_beg < 9)  iyear_beg = iyear_beg + 100
+         IF ((iyear_beg < 30) .OR. (iyear_beg > 107)) THEN
+            qtr_cfc(:,:,:) = 0._wp
+            IF(lwp) THEN
+               WRITE(numout,*)
+               WRITE(numout,*) 'restart a CFC cycle or out of P_cfc year bounds zero --'
+               WRITE(numout,*) '                          --    set qtr_CFC = 0.00   --'
+               WRITE(numout,*) '                          --   set qint_CFC = 0.00   --'
+               WRITE(numout,*) '                          --   set trn(CFC) = 0.00   --'
+            ENDIF
+            qtr_cfc(:,:,:) = 0._wp
+            qint_cfc(:,:,:) = 0._wp
+            DO jl = 1, jp_cfc
+              jn = jp_cfc0 + jl - 1
+              trn(:,:,:,jn) = 0._wp
+              trb(:,:,:,jn) = 0._wp
+            END DO
+         ENDIF
+      ENDIF
+
       IF(lwp) WRITE(numout,*)
       !
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/gas_transfer.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/gas_transfer.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/gas_transfer.F90	(revision 6715)
@@ -24,5 +24,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007) 
-   !! $Id: trcbio.F90 1146 2008-06-25 11:42:56Z rblod $ 
+   !! $Id$
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/mocsy_wrapper.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/mocsy_wrapper.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/mocsy_wrapper.F90	(revision 6715)
@@ -28,5 +28,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007) 
-   !! $Id: trcbio.F90 1146 2008-06-25 11:42:56Z rblod $ 
+   !! $Id$
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 6715)
@@ -49,4 +49,5 @@
    REAL(wp) ::  xthetam   !:  maximum Chl to C ratio for non-diatoms      
    REAL(wp) ::  xthetamd  !:  maximum Chl to C ratio for diatoms    
+   REAL(wp) ::  jq10      !:  specific Q10 value (jphy==2)    
 !!
 !! Diatom silicon parameters
@@ -237,4 +238,13 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: zn_dms_din  !: 2D avg DIN   (now)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: za_dms_din  !: 2D avg DIN   (after)
+!!
+!! 2D fields needing to be knows at first tstp for coupling with atm - UKEMS(Jpalm,14-06-2016)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: zb_co2_flx  !: 2D avg fx co2 (before)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: zn_co2_flx  !: 2D avg fx co2 (now)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: za_co2_flx  !: 2D avg fx co2 (after)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: zb_dms_srf  !: 2D avg fx co2 (before)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: zn_dms_srf  !: 2D avg fx co2 (now)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: za_dms_srf  !: 2D avg fx co2 (after)
+
 #endif
 
@@ -469,4 +479,10 @@
          &      zb_dms_din(jpi,jpj)  , zn_dms_din(jpi,jpj)  ,       &		  
          &      za_dms_din(jpi,jpj)  ,                           STAT=ierr(4) )
+      !* 2D fields needing to be knows at first tstp for coupling with atm -
+      !UKEMSi (Jpalm,14-06-2016) 
+      ALLOCATE( zb_co2_flx(jpi,jpj)  , zn_co2_flx(jpi,jpj)  ,       &
+         &      za_co2_flx(jpi,jpj)  ,                              &
+         &      zb_dms_srf(jpi,jpj)  , zn_dms_srf(jpi,jpj)  ,       &           
+         &      za_dms_srf(jpi,jpj)  ,                           STAT=ierr(5) )
 # endif
       !* 2D fields of miscellaneous parameters
@@ -474,8 +490,8 @@
          &      riv_n(jpi,jpj)                              ,       &
          &      riv_si(jpi,jpj)      , riv_c(jpi,jpj)       ,       &
-         &      riv_alk(jpi,jpj)     , friver_dep(jpk,jpk)  ,    STAT=ierr(5) )
+         &      riv_alk(jpi,jpj)     , friver_dep(jpk,jpk)  ,    STAT=ierr(6) )
       !* 2D and 3D fields of light parameters
       ALLOCATE( neln(jpi,jpj)        , xze(jpi,jpj)         ,       &
-         &      xpar(jpi,jpj,jpk)    ,                           STAT=ierr(6) )
+         &      xpar(jpi,jpj,jpk)    ,                           STAT=ierr(7) )
       !* 2D and 3D fields of sediment-associated parameters
       ALLOCATE( dminl(jpi,jpj)       , dmin3(jpi,jpj,jpk)   ,       &
@@ -484,5 +500,5 @@
          &      fbodf(jpi,jpj)       , fbods(jpi,jpj)       ,       &
          &      ffln(jpi,jpj,jpk)    , fflf(jpi,jpj,jpk)    ,       &
-         &      ffls(jpi,jpj,jpk)    , cmask(jpi,jpj)       ,    STAT=ierr(7) ) 
+         &      ffls(jpi,jpj,jpk)    , cmask(jpi,jpj)       ,    STAT=ierr(8) ) 
 #endif
       !
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcavg_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcavg_medusa.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcavg_medusa.F90	(revision 6715)
@@ -28,5 +28,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007) 
-   !! $Id: trcbio.F90 1146 2008-06-25 11:42:56Z rblod $ 
+   !! $Id$
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 6715)
@@ -175,4 +175,8 @@
       REAL(wp) ::    loc_T,fun_T,xvpnT,xvpdT
       INTEGER  ::    ieppley
+      !! AXY (16/05/11): per Katya's prompting, add in new T-dependence
+      !!                 for phytoplankton growth only (i.e. no change
+      !!                 for remineralisation)
+      REAL(wp) ::    fun_Q10
       !! AXY (01/03/10): add in mixed layer PP diagnostics
       REAL(wp), DIMENSION(jpi,jpj) ::  fprn_ml,fprd_ml
@@ -316,4 +320,8 @@
       !! AXY (13/03/15): add in other DMS calculations
       REAL(wp) ::    dms_andr, dms_simo, dms_aran, dms_hall
+#  if defined key_oasis3
+      REAL(wp), DIMENSION(jpi,jpj) :: pco2a_2d(ji,jj)        !! use 2D atm pCO2 from atm coupling
+#  endif
+
 # endif
       !! 
@@ -353,8 +361,9 @@
       REAL(wp), POINTER, DIMENSION(:,:  ) :: mdetc2d, gmidc2d, gmedc2d, f_pco2a2d, f_pco2w2d, f_co2flux2d
       REAL(wp), POINTER, DIMENSION(:,:  ) :: f_TDIC2d, f_TALK2d, f_kw6602d, f_pp02d, f_o2flux2d, f_o2sat2d
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: dms_surf2d, dms_andr2d, dms_simo2d, dms_aran2d, dms_hall2d
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: dms_andr2d, dms_simo2d, dms_aran2d, dms_hall2d, dms_surf2d
       REAL(wp), POINTER, DIMENSION(:,:  ) :: iben_n2d, iben_fe2d, iben_c2d, iben_si2d, iben_ca2d, oben_n2d
       REAL(wp), POINTER, DIMENSION(:,:  ) :: oben_fe2d, oben_c2d, oben_si2d, oben_ca2d, sfr_ocal2d
       REAL(wp), POINTER, DIMENSION(:,:  ) :: sfr_oarg2d, lyso_ca2d 
+
 # endif
       !! 2D var for diagnostics.
@@ -814,5 +823,5 @@
       ENDIF
       IF( med_diag%CO2FLUX%dgsave ) THEN
-         CALL wrk_alloc( jpi, jpj,    f_co2flux2d   )
+         CALL wrk_alloc( jpi, jpj,   f_co2flux2d    )
          f_co2flux2d(:,:)      = 0.0      !!
       ENDIF
@@ -897,22 +906,22 @@
       IF (jdms .eq. 1) THEN
          IF( med_diag%DMS_SURF%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,  dms_surf2d     )
-         dms_surf2d(:,:)      = 0.0      !!
+            CALL wrk_alloc( jpi, jpj,   dms_surf2d    )
+            dms_surf2d(:,:)      = 0.0      !!
          ENDIF
          IF( med_diag%DMS_ANDR%dgsave ) THEN
             CALL wrk_alloc( jpi, jpj,   dms_andr2d    )
-         dms_andr2d(:,:)      = 0.0      !!
+            dms_andr2d(:,:)      = 0.0      !!
          ENDIF
          IF( med_diag%DMS_SIMO%dgsave ) THEN
             CALL wrk_alloc( jpi, jpj,  dms_simo2d     )
-         dms_simo2d(:,:)      = 0.0      !!
+            dms_simo2d(:,:)      = 0.0      !!
          ENDIF
          IF( med_diag%DMS_ARAN%dgsave ) THEN
             CALL wrk_alloc( jpi, jpj,   dms_aran2d    )
-         dms_aran2d(:,:)      = 0.0      !!
+            dms_aran2d(:,:)      = 0.0      !!
          ENDIF
          IF( med_diag%DMS_HALL%dgsave ) THEN
             CALL wrk_alloc( jpi, jpj,   dms_hall2d    )
-         dms_hall2d(:,:)      = 0.0      !!
+            dms_hall2d(:,:)      = 0.0      !!
          ENDIF
       ENDIF   
@@ -1042,4 +1051,7 @@
                   !! OPEN wet point IF..THEN loop
                   if (tmask(ji,jj,jk).eq.1) then
+#  if defined key_oasis3
+                     f_pco2a = pco2a_2d(ji,jj)        !! use 2D atm pCO2 from atm coupling
+#  endif
                      !! do carbonate chemistry
                      !!
@@ -1371,4 +1383,8 @@
                   !!
                   f_wind  = wndm(ji,jj)
+#  if defined key_oasis3
+                  f_pco2a = pco2a_2d(ji,jj)        !! use 2D atm pCO2 from atm coupling
+#  endif
+
                   !!
                   !! AXY (23/06/15): as part of an effort to update the carbonate chemistry
@@ -1706,7 +1722,14 @@
                loc_T   = tsn(ji,jj,jk,jp_tem)
                fun_T   = 1.066**(1.0 * loc_T)
+               !! AXY (16/05/11): add in new Q10 (1.5, not 2.0) for
+               !phytoplankton
+               !!                 growth; remin. unaffected
+               fun_Q10 = jq10**((loc_T - 0.0) / 10.0)
                if (jphy.eq.1) then
                   xvpnT = xvpn * fun_T
                   xvpdT = xvpd * fun_T
+               elseif (jphy.eq.2) then
+                  xvpnT = xvpn * fun_Q10
+                  xvpdT = xvpd * fun_Q10
                else
                   xvpnT = xvpn
@@ -2126,4 +2149,11 @@
                   fddc = xmdc * fun_T * zdtc
 # endif
+               elseif (jmd.eq.2) then
+                  !! AXY (16/05/13): add in Q10-based parameterisation (def in nmlst)
+                  !! temperature-dependent
+                  fdd  = xmd  * fun_Q10 * zdet
+#if defined key_roam
+                  fddc = xmdc * fun_Q10 * zdtc
+#endif
                else
                   !! temperature-independent
@@ -4327,5 +4357,7 @@
                      IF( med_diag%CO2FLUX%dgsave ) THEN
                          CALL iom_put( "CO2FLUX"  , f_co2flux2d )
-                          CALL wrk_dealloc( jpi, jpj,   f_co2flux2d   )
+                         zb_co2_flx = zn_co2_flx
+                         zn_co2_flx = f_co2flux2d
+                         CALL wrk_dealloc( jpi, jpj,   f_co2flux2d   )
                      ENDIF
                      IF( med_diag%OM_CAL%dgsave ) THEN
@@ -4368,5 +4400,7 @@
                        IF( med_diag%DMS_SURF%dgsave ) THEN
                          CALL iom_put( "DMS_SURF"  , dms_surf2d )
-                          CALL wrk_dealloc( jpi, jpj,   dms_surf2d   )
+                         zb_dms_srf = zn_dms_srf
+                         zn_dms_srf = dms_surf2d
+                         CALL wrk_dealloc( jpi, jpj,   dms_surf2d   ) 
                        ENDIF
                        IF( med_diag%DMS_ANDR%dgsave ) THEN
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 6715)
@@ -258,5 +258,19 @@
       IF(lwp) WRITE(numout,*) ' trc_ini_medusa: average fields for DMS initialised to zero'
       IF(lwp) CALL flush(numout)
-
+      !!
+      !!---------------------------------------------------------------------
+      !!JPALM (14-06-2016): init dms and co2 flux for coupling with atm (UKESM)
+      !!---------------------------------------------------------------------
+      !!
+      zb_co2_flx(:,:)  = 0.0  !! CHN
+      zn_co2_flx(:,:)  = 0.0
+      za_co2_flx(:,:)  = 0.0
+      zb_dms_srf(:,:)  = 0.0  !! CHD
+      zn_dms_srf(:,:)  = 0.0
+      za_dms_srf(:,:)  = 0.0
+      !!
+      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: DMS and CO2 flux (UKESM) initialised to zero'
+      IF(lwp) CALL flush(numout)
+      !!
       !!----------------------------------------------------------------------
       !! AXY (04/11/13): initialise fields previously done by trc_sed_medusa
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 6715)
@@ -65,5 +65,5 @@
       !
       NAMELIST/natbio/ xxi,xaln,xald,jphy,xvpn,xvpd,          &
-      &    xsin0,xnsi0,xuif,jliebig,                          &
+      &    xsin0,xnsi0,xuif,jliebig, jq10,                    &
       &    xthetam,xthetamd,xnln,xnld,xsld,xfln,xfld,         &
       &  xgmi,xgme,xkmi,xkme,xphi,xbetan,xbetac,xkc,          &
@@ -586,4 +586,7 @@
             WRITE(numout,*) &
             &   ' phytoplankton growth is *temperature-dependent*            jphy        = ', jphy
+         elseif (jphy.eq.2) then
+            WRITE(numout,*) &
+            &   ' phytoplankton growth is *temperature-dependent(Q10)*       jphy        = ', jphy
          elseif (jphy.eq.0) then
             WRITE(numout,*) &
@@ -598,4 +601,6 @@
          WRITE(numout,*)     &
          &   ' maximum Chl to C ratio for diatoms,                        xthetamd    = ', xthetamd
+         WRITE(numout,*)     &
+         &   ' specific Q10 value (jphy==2),                                  jq10    = ', jq10
 !!
 !! Diatom silicon parameters
@@ -746,4 +751,7 @@
             WRITE(numout,*) &
             &   ' detritus remineralisation is *temperature-dependent*       jmd         = ', jmd
+         elseif (jmd.eq.2) then
+            WRITE(numout,*) &
+            &   ' detritus remineralisation is *temperature-dependent(Q10)*  jmd         = ', jmd
          elseif (jmd.eq.0) then
             WRITE(numout,*) &
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/par_trc.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/par_trc.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/par_trc.F90	(revision 6715)
@@ -18,4 +18,5 @@
    USE par_medusa    ! MEDUSA model
    USE par_idtra     ! Idealize tracer
+   USE par_age       ! AGE  tracer
 
    IMPLICIT NONE
@@ -27,9 +28,9 @@
    ! Passive tracers : Total size
    ! ---------------               ! total number of passive tracers, of 2d and 3d output and trend arrays
-   INTEGER, PUBLIC,  PARAMETER ::   jptra    =  jp_pisces     + jp_cfc     + jp_c14b    + jp_my_trc    + jp_medusa    + jp_idtra
-   INTEGER, PUBLIC,  PARAMETER ::   jpdia2d  =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d + jp_my_trc_2d + jp_medusa_2d + jp_idtra_2d
-   INTEGER, PUBLIC,  PARAMETER ::   jpdia3d  =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d + jp_my_trc_3d + jp_medusa_3d + jp_idtra_3d
+   INTEGER, PUBLIC,  PARAMETER ::   jptra    =  jp_pisces     + jp_cfc     + jp_c14b    + jp_my_trc    + jp_medusa    + jp_idtra     + jp_age
+   INTEGER, PUBLIC,  PARAMETER ::   jpdia2d  =  jp_pisces_2d  + jp_cfc_2d  + jp_c14b_2d + jp_my_trc_2d + jp_medusa_2d + jp_idtra_2d  + jp_age_2d
+   INTEGER, PUBLIC,  PARAMETER ::   jpdia3d  =  jp_pisces_3d  + jp_cfc_3d  + jp_c14b_3d + jp_my_trc_3d + jp_medusa_3d + jp_idtra_3d  + jp_age_3d
    !                     ! total number of sms diagnostic arrays
-   INTEGER, PUBLIC,  PARAMETER ::   jpdiabio =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_my_trc_trd + jp_medusa_trd + jp_idtra_trd
+   INTEGER, PUBLIC,  PARAMETER ::   jpdiabio =  jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_my_trc_trd + jp_medusa_trd + jp_idtra_trd + jp_age_trd
    
    !  1D configuration ("key_c1d")
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 6715)
@@ -27,4 +27,5 @@
    USE trcini_medusa   ! MEDUSA   initialisation
    USE trcini_idtra    ! idealize tracer initialisation
+   USE trcini_age      ! AGE      initialisation
    USE trcdta          ! initialisation from files
    USE daymod          ! calendar manager
@@ -107,4 +108,5 @@
       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
 
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 6715)
@@ -28,4 +28,5 @@
    USE trcnam_medusa     ! MEDUSA namelist
    USE trcnam_idtra      ! Idealise tracer namelist
+   USE trcnam_age        ! AGE SMS namelist
    USE trd_oce       
    USE trdtrc_oce
@@ -57,5 +58,5 @@
       !! ** Method  : - read passive tracer namelist 
       !!              - read namelist of each defined SMS model
-      !!                ( (PISCES, CFC, MY_TRC, MEDUSA, IDTRA )
+      !!                ( (PISCES, CFC, MY_TRC, MEDUSA, IDTRA, Age )
       !!---------------------------------------------------------------------
       INTEGER  ::   jn, jk                     ! dummy loop indice
@@ -276,5 +277,5 @@
       IF (lwp) write (numout,*) 'Jpalm - debug'
       IF (lwp) write (numout,*) 'CALL trc_nam_cfc -- OK'
-      IF (lwp) write (numout,*) 'in trc_nam - CALL trc_nam OK'
+      IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_c14'
       IF (lwp) write (numout,*) ' '
 # endif
@@ -283,5 +284,27 @@
       ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
       ENDIF
-
+      !
+# if defined key_debug_medusa
+      CALL flush(numout)
+      IF (lwp) write (numout,*) '------------------------------'
+      IF (lwp) write (numout,*) 'Jpalm - debug'
+      IF (lwp) write (numout,*) 'CALL trc_nam_c14 -- OK'
+      IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_age'
+      IF (lwp) write (numout,*) ' '
+# endif
+      !
+      IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer
+      ELSE                   ;   IF(lwp) WRITE(numout,*) '          AGE not used'
+      ENDIF
+      !
+# if defined key_debug_medusa
+      CALL flush(numout)
+      IF (lwp) write (numout,*) '------------------------------'
+      IF (lwp) write (numout,*) 'Jpalm - debug'
+      IF (lwp) write (numout,*) 'CALL trc_nam_age -- OK'
+      IF (lwp) write (numout,*) 'in trc_nam - CALL trc_nam -- OK'
+      IF (lwp) write (numout,*) ' '
+# endif
+      !
       IF( lk_my_trc  ) THEN   ;   CALL trc_nam_my_trc      ! MY_TRC  tracers
       ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 6715)
@@ -239,4 +239,26 @@
          zn_dms_din(:,:)  = 0.0
       ENDIF
+      !!  
+      !! JPALM 14-06-2016 -- add CO2 flux and DMS surf through the restart
+      !!                  -- needed for the coupling with atm
+      IF( iom_varid( numrtr, 'B_DMS_srf', ldstop = .FALSE. ) > 0 ) THEN
+         IF(lwp) WRITE(numout,*) 'DMS surf concentration - reading in ...'
+         CALL iom_get( numrtr, jpdom_autoglo, 'B_DMS_srf',  zb_dms_srf(:,:)  )
+         CALL iom_get( numrtr, jpdom_autoglo, 'N_DMS_srf',  zn_dms_srf(:,:)  )
+      ELSE
+         IF(lwp) WRITE(numout,*) 'DMS surf concentration - setting to zero ...'
+         zb_dms_srf(:,:)  = 0.0   !! DMS
+         zn_dms_srf(:,:)  = 0.0
+      ENDIF
+      !!
+      IF( iom_varid( numrtr, 'B_CO2_flx', ldstop = .FALSE. ) > 0 ) THEN
+         IF(lwp) WRITE(numout,*) 'CO2 air-sea flux - reading in ...'
+         CALL iom_get( numrtr, jpdom_autoglo, 'B_CO2_flx',  zb_co2_flx(:,:)  )
+         CALL iom_get( numrtr, jpdom_autoglo, 'N_CO2_flx',  zn_co2_flx(:,:)  )
+      ELSE
+         IF(lwp) WRITE(numout,*) 'CO2 air-sea flux - setting to zero ...'
+         zb_co2_flx(:,:)  = 0.0   !! CO2 flx
+         zn_co2_flx(:,:)  = 0.0
+      ENDIF
       !!
       !! calculate stats on these fields
@@ -247,4 +269,6 @@
       call trc_rst_dia_stat(zn_dms_qsr(:,:), 'DMS, QSR')
       call trc_rst_dia_stat(zn_dms_din(:,:), 'DMS, DIN')
+      call trc_rst_dia_stat(zn_dms_srf(:,:), 'DMS surf')
+      call trc_rst_dia_stat(zn_co2_flx(:,:), 'CO2 flux')
 #endif
       !
@@ -366,4 +390,10 @@
       CALL iom_rstput( kt, nitrst, numrtw, 'B_DMS_DIN',  zb_dms_din(:,:)  )
       CALL iom_rstput( kt, nitrst, numrtw, 'N_DMS_DIN',  zn_dms_din(:,:)  )
+         !! JPALM 14-06-2016 -- add CO2 flux and DMS surf through the restart
+         !!                  -- needed for the coupling with atm
+      CALL iom_rstput( kt, nitrst, numrtw, 'B_DMS_srf',  zb_dms_srf(:,:)  )
+      CALL iom_rstput( kt, nitrst, numrtw, 'N_DMS_srf',  zn_dms_srf(:,:)  )
+      CALL iom_rstput( kt, nitrst, numrtw, 'B_CO2_flx',  zb_co2_flx(:,:)  )
+      CALL iom_rstput( kt, nitrst, numrtw, 'N_CO2_flx',  zn_co2_flx(:,:)  )
       !!
       !! calculate stats on these fields
@@ -374,4 +404,6 @@
       call trc_rst_dia_stat(zn_dms_qsr(:,:), 'DMS, QSR')
       call trc_rst_dia_stat(zn_dms_din(:,:), 'DMS, DIN')
+      call trc_rst_dia_stat(zn_dms_srf(:,:), 'DMS surf')
+      call trc_rst_dia_stat(zn_co2_flx(:,:), 'CO2 flux')
       !! 
 #endif
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 6715)
@@ -20,4 +20,5 @@
    USE trcsms_cfc         ! CFC 11 & 12
    USE trcsms_c14b        ! C14b tracer 
+   USE trcsms_age         ! AGE tracer 
    USE trcsms_my_trc      ! MY_TRC  tracers
    USE prtctl_trc         ! Print control for debbuging
@@ -64,8 +65,17 @@
       IF( lk_cfc     )   CALL trc_sms_cfc    ( kt )    ! surface fluxes of CFC
 # if defined key_debug_medusa
-         IF(lwp) WRITE(numout,*) '--trcsms : CFC OK --  continue -- '
+         IF(lwp) WRITE(numout,*) '--trcsms : CFC OK --  next C14 -- '
       CALL flush(numout)
 # endif
       IF( lk_c14b    )   CALL trc_sms_c14b   ( kt )    ! surface fluxes of C14
+# if defined key_debug_medusa
+         IF(lwp) WRITE(numout,*) '--trcsms : C14 OK --  next C14 -- '
+      CALL flush(numout)
+# endif
+      IF( lk_age     )   CALL trc_sms_age    ( kt )    ! AGE tracer
+# if defined key_debug_medusa
+         IF(lwp) WRITE(numout,*) '--trcsms : Age OK --  Continue  -- '
+      CALL flush(numout)
+# endif
       IF( lk_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers
 
Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 6645)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 6715)
@@ -24,4 +24,5 @@
    USE trcwri_medusa
    USE trcwri_idtra
+   USE trcwri_age
 
    IMPLICIT NONE
@@ -60,38 +61,10 @@
       ! ---------------------------------------
       IF( lk_pisces  )   CALL trc_wri_pisces     ! PISCES 
+      IF( lk_medusa  )   CALL trc_wri_medusa     ! MESDUSA
+      IF( lk_idtra   )   CALL trc_wri_idtra       ! Idealize 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 defined key_debug_medusa
-      CALL flush(numout)
-      IF (lwp) write (numout,*) '------------------------------'
-      IF (lwp) write (numout,*) 'Jpalm - debug'
-      IF (lwp) write (numout,*) 'Just before call trc_wri_medusa'
-      IF (lwp) write (numout,*) ' '
-      CALL flush(numout)
-# endif
-      !
-      IF( lk_medusa  )   CALL trc_wri_medusa     ! MESDUSA
-      !
-# if defined key_debug_medusa
-      CALL flush(numout)
-      IF (lwp) write (numout,*) '------------------------------'
-      IF (lwp) write (numout,*) 'Jpalm - debug'
-      IF (lwp) write (numout,*) 'CALL trc_wri_medusa -- OK'
-      IF (lwp) write (numout,*) ' '
-      CALL flush(numout)
-# endif
-      !
-      IF( lk_idtra   )   CALL trc_wri_idtra       ! Idealize tracers
-      !
-# if defined key_debug_medusa
-      CALL flush(numout)
-      IF (lwp) write (numout,*) '------------------------------'
-      IF (lwp) write (numout,*) 'Jpalm - debug'
-      IF (lwp) write (numout,*) 'CALL trc_wri_idtra -- OK'
-      IF (lwp) write (numout,*) ' '
-      CALL flush(numout)
-# endif
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
