Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/par_sms_cfc.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/par_sms_cfc.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/par_sms_cfc.h90	(revision 764)
@@ -0,0 +1,16 @@
+   !!---------------------------------------------------------------------
+   !!                     ***  par_sms_cfc.h90  ***  
+   !!                    CFC Source Minus Sink model
+   !!---------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   INTEGER, PARAMETER ::   jpyear = 100   ! temporal parameter 
+   INTEGER, PARAMETER ::   jphem  = 2     ! hemispheric parameter
+
+   INTEGER, PARAMETER ::   jp11   = 1     ! CFC-11
+   INTEGER, PARAMETER ::   jp12   = 2     ! CFC-12
Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/sms_cfc.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/sms_cfc.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/sms_cfc.h90	(revision 764)
@@ -0,0 +1,21 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  sms_cfc.h90  ***  
+   !! TOP :   CFC Source Minus Sink valiables
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   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) 
+   
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)             ::   xphem    ! spatial interpolation factor for patm
+   REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, jptra) ::   p_cfc    ! partial hemispheric pressure for CFC          
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj      ,jptra) ::   pp_cfc   ! temporal interpolation of atmospheric concentrations 
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj      ,jptra) ::   qtr      ! input function
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj      ,jptra) ::   qint     ! flux function
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcctl.cfc.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcctl.cfc.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcctl.cfc.h90	(revision 764)
@@ -0,0 +1,82 @@
+   !!======================================================================
+   !!                         ***  trcctl.cfc.h90  ***
+   !! TOP :   Control of CFC chemical model
+   !!======================================================================
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2005-10 (C. Ethe) assign a parameter to name individual tracers
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+
+      IF(lwp) THEN
+          WRITE(numout,*) ' CFC Model '
+          WRITE(numout,*) ' '
+      ENDIF
+
+      ! Check number of tracers
+      ! -----------------------   
+      IF( jptra > 2) THEN 
+          IF(lwp) THEN 
+              WRITE (numout,*) ' ===>>>> : w a r n i n g '
+              WRITE (numout,*) ' =======   ============= '
+              WRITE (numout,*)                             &
+              &   ' STOP, change jptra to 1 or 2 in par_sms_cfc.h90 '  
+          END IF 
+          STOP 'TRC_CTL'
+      END IF 
+
+      ! Check tracer names
+      ! ------------------
+      IF( jptra == 1 ) THEN
+         IF ( jp11 == 1 ) THEN
+            IF ( ctrcnm(jp11) /= 'CFC11') THEN
+               ctrcnm(jp11) = 'CFC11'
+               ctrcnl(jp11) = 'Chlorofuorocarbone 11 concentration'
+            ENDIF
+         ENDIF
+         IF( jp12 == 1 ) THEN
+            IF ( ctrcnm(jp12) /= 'CFC12') THEN
+               ctrcnm(jp12) = 'CFC12'
+               ctrcnl(jp12) = 'Chlorofuorocarbone 12 concentration'
+            ENDIF
+         ENDIF
+      ENDIF
+
+      IF( jptra == 2 ) THEN
+         IF ( ctrcnm(jp11) /= 'CFC11' .OR. ctrcnm(jp12) /= 'CFC12' ) THEN 
+            ctrcnm(jp11) = 'CFC11'
+            ctrcnl(jp11) = 'Chlorofuorocarbone 11 concentration'
+            ctrcnm(jp12) = 'CFC12'
+            ctrcnl(jp12) = 'Chlorofuorocarbone 12 concentration' 
+         ENDIF
+      ENDIF
+
+      IF(lwp) THEN
+         WRITE (numout,*) ' ===>>>> : w a r n i n g '
+         WRITE (numout,*) ' =======   ============= '
+         WRITE (numout,*) ' we force tracer names'
+         DO jn = 1, jptra
+            WRITE(numout,*) ' tracer nb: ',jn,' name = ',ctrcnm(jn), ctrcnl(jn)
+         END DO
+         WRITE(numout,*) ' '
+      ENDIF 
+
+
+      ! Check tracer units
+      ! ------------------
+      DO jn = 1, jptra
+        IF( ctrcun(jn) /= 'mole/m3' ) THEN
+            ctrcun(jn) = 'mole/m3'
+            IF(lwp) THEN
+               WRITE (numout,*) ' ===>>>> : w a r n i n g '
+               WRITE (numout,*) ' =======   ============= '
+               WRITE (numout,*) ' we force tracer unit'
+               WRITE(numout,*) ' tracer  ',ctrcnm(jn), 'UNIT= ',ctrcun(jn)
+               WRITE(numout,*) ' '
+            ENDIF 
+         ENDIF 
+      END DO              
Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcfreons.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcfreons.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcfreons.F90	(revision 764)
@@ -0,0 +1,271 @@
+MODULE trcfreons
+   !!======================================================================
+   !!                      ***  MODULE trcfreons  ***
+   !! TOP : CFC main model
+   !!======================================================================
+   !! History :    -   !  1999-10  (JC. Dutay)  original code
+   !!             1.0  !  2004-03 (C. Ethe) free form + modularity
+   !!----------------------------------------------------------------------
+#if defined key_cfc
+   !!----------------------------------------------------------------------
+   !!   'key_cfc'                                        CFC chemical model
+   !!----------------------------------------------------------------------
+   !!   trc_freons     :  compute and add CFC suface forcing to CFC trends
+   !!   trc_freons_cst :  sets constants for CFC surface forcing computation
+   !!----------------------------------------------------------------------
+   USE daymod
+   USE sms
+   USE oce_trc
+   USE trc
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   trc_freons       ! called in ???    
+
+   REAL(wp), DIMENSION(jptra) ::   soa1, soa2, soa3, soa4   ! coefficient for solubility of CFC [mol/l/atm]
+   REAL(wp), DIMENSION(jptra) ::   sob1, sob2, sob3         !    "               "
+   REAL(wp), DIMENSION(jptra) ::   sca1, sca2, sca3, sca4   ! coefficients for schmidt number in degre Celcius
+      
+   !                          ! coefficients for conversion
+   REAL(wp) ::   xconv1 = 1.0          ! conversion from to 
+   REAL(wp) ::   xconv2 = 0.01/3600.   ! conversion from cm/h to m/s: 
+   REAL(wp) ::   xconv3 = 1.0e+3       ! conversion from mol/l/atm to mol/m3/atm
+   REAL(wp) ::   xconv4 = 1.0e-12      ! conversion from mol/m3/atm to mol/m3/pptv 
+
+   !! * Substitutions
+#  include "passivetrc_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_freons( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_freons  ***
+      !!
+      !! ** Purpose :   Compute the surface boundary contition on freon 11 
+      !!      passive tracer associated with air-mer fluxes and add it to 
+      !!      the general trend of tracers equations.
+      !!
+      !! ** Method :
+      !!          - get the atmospheric partial pressure - given in pico -
+      !!          - computation of solubility ( in 1.e-12 mol/l then in 1.e-9 mol/m3)
+      !!          - computation of transfert speed ( given in cm/hour ----> cm/s )
+      !!          - the input function is given by : 
+      !!            speed * ( concentration at equilibrium - concemtration at surface )
+      !!          - the input function is in pico-mol/m3/s and the
+      !!            freons concentration in pico-mol/m3
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in ) ::   kt    ! ocean time-step index
+      !!
+      INTEGER ::   ji, jj, jn, jm
+      INTEGER ::   iyear_beg, iyear_end
+      INTEGER ::   imonth, im1, im2
+
+      REAL(wp) ::   ztap, zdtap        
+      REAL(wp) ::   zt1, zt2, zt3, zv2
+      REAL(wp) ::   zsol   ! solubility
+      REAL(wp) ::   zsch   ! schmidt number 
+      
+      REAL(wp), DIMENSION(jphem,jptra) ::   zpatm       ! atmospheric function
+      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   zca_cfc   ! concentration
+      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   zak_cfc   ! transfert coefficients
+      !!----------------------------------------------------------------------
+
+      IF( kt == nittrc000 )   CALL trc_freons_cst
+
+      ! Temporal interpolation
+      ! ----------------------
+      iyear_beg = nyear + ( nyear_res - 1900 - nyear_beg  )
+      imonth    = nmonth
+
+      IF ( imonth .LE. 6 ) THEN
+         iyear_beg = iyear_beg - 2 + nyear_beg
+         im1       = 6 - imonth + 1
+         im2       = 6 + imonth - 1
+      ELSE
+         iyear_beg = iyear_beg - 1 + nyear_beg
+         im1       = 12 - imonth + 7
+         im2       =      imonth - 7
+      ENDIF
+
+      iyear_end = iyear_beg + 1
+
+
+      !  Temporal and spatial interpolation at time k
+      ! --------------------------------------------------
+      DO jn = 1, jptra
+         DO  jm = 1, jphem
+            zpatm(jm,jn) = (  p_cfc(iyear_beg, jm, jn) * FLOAT (im1)  &
+               &           +  p_cfc(iyear_end, jm, jn) * FLOAT (im2) ) / 12.
+         END DO
+      END DO
+
+      DO jn = 1, jptra
+         pp_cfc(:,:,jn) =       xphem(:,:)   * zpatm(1,jn)   &
+            &           + ( 1.- xphem(:,:) ) * zpatm(2,jn)
+      END DO
+
+
+      !------------------------------------------------------------
+      ! Computation of concentration at equilibrium : in picomol/l
+      ! -----------------------------------------------------------
+
+      DO jn = 1, jptra
+         DO jj = 1 , jpj
+            DO ji = 1 , jpi
+               ! coefficient for solubility for CFC-11/12 in  mol/l/atm
+               IF( tmask(ji,jj,1) .GE. 0.5 ) THEN
+                  ztap  = ( tn(ji,jj,1) + 273.16 )* 0.01
+                  zdtap = ( sob3(jn) * ztap + sob2(jn))* ztap + sob1(jn) 
+                  zsol  =  EXP ( soa1(jn) + soa2(jn) / ztap + soa3(jn) * LOG ( ztap )   &
+                     &                   + soa4(jn) * ztap * ztap + sn(ji,jj,1) * zdtap ) 
+               ELSE
+                  zsol  = 0.
+               ENDIF
+               ! conversion from mol/l/atm to mol/m3/atm and from mol/m3/atm to mol/m3/pptv    
+               zsol = xconv4 * xconv3 * zsol * tmask(ji,jj,1)  
+               ! concentration at equilibrium
+               zca_cfc(ji,jj,jn) = xconv1 * pp_cfc(ji,jj,jn) * zsol * tmask(ji,jj,1)             
+            END DO
+         END DO
+      END DO
+
+  
+      !-------------------------------
+      ! Computation of speed transfert
+      ! ------------------------------
+
+      DO jn = 1, jptra
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               ! Schmidt number
+               zt1  = tn(ji,jj,1)
+               zt2  = zt1 * zt1 
+               zt3  = zt1 * zt2
+               zsch = sca1(jn) + sca2(jn) * zt1 + sca3(jn) * zt2 + sca4(jn) * zt3
+               ! speed transfert : formulae of wanninkhof 1992
+               zv2 = vatm(ji,jj) * vatm(ji,jj)
+               zsch = zsch / 660.
+               zak_cfc(ji,jj,jn) = ( 0.39 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1)
+            END DO
+         END DO
+      END DO
+
+
+      !----------------------------------------------------------------
+      ! Input function  : speed *( conc. at equil - concen at surface )
+      ! trn in pico-mol/l idem qtr; ak in en m/s
+      !-----------------------------------------------------------------
+
+      DO jn = 1, jptra
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               qtr(ji,jj,jn) = -zak_cfc(ji,jj,jn) * ( trb(ji,jj,1,jn) - zca_cfc(ji,jj,jn) )   &
+#if defined key_off_degrad
+                  &                               * facvol(ji,jj,1)                           &
+#endif
+                  &                               * tmask(ji,jj,1) * ( 1. - freeze(ji,jj) )
+            END DO
+         END DO
+      END DO
+
+
+      ! ---------------------
+      ! Add the trend
+      ! ---------------------
+
+      DO jn = 1, jptra
+         DO  jj = 1, jpj
+            DO  ji = 1, jpi
+               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + qtr(ji,jj,jn) / fse3t(ji,jj,1) 
+            END DO
+         END DO
+      END DO
+
+      ! --------------------------------------------
+      ! cumulation of tracer flux at each time step
+      ! --------------------------------------------
+      DO jn = 1, jptra
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               qint(ji,jj,jn) = qint (ji,jj,jn) + qtr(ji,jj,jn) * rdt
+            END DO
+         END DO
+      END DO
+      !
+   END SUBROUTINE trc_freons
+
+
+   SUBROUTINE trc_freons_cst
+      !!---------------------------------------------------------------------
+      !!                     ***  trc_freons_cst  ***  
+      !!
+      !! ** Purpose : sets constants for CFC model
+      !!---------------------------------------------------------------------
+      INTEGER ::   jn
+      !!---------------------------------------------------------------------
+
+      DO jn = 1, jptra
+         IF ( jn == jp11 ) THEN
+            ! coefficient for solubility of CFC11 in  mol/l/atm
+            soa1(jn) = -229.9261 
+            soa2(jn) =  319.6552
+            soa3(jn) =  119.4471
+            soa4(jn) =  -1.39165
+            sob1(jn) =  -0.142382
+            sob2(jn) =   0.091459
+            sob3(jn) =  -0.0157274
+            
+            ! coefficients for schmidt number in degre Celcius
+            sca1(jn) = 3501.8
+            sca2(jn) = -210.31
+            sca3(jn) = 6.1851
+            sca4(jn) = -0.07513
+
+         ELSE IF( jn == jp12 ) THEN
+
+            ! coefficient for solubility of CFC12 in  mol/l/atm
+            soa1(jn) = -218.0971
+            soa2(jn) =  298.9702
+            soa3(jn) =  113.8049
+            soa4(jn) =  -1.39165
+            sob1(jn) =  -0.143566
+            sob2(jn) =   0.091015
+            sob3(jn) =  -0.0153924
+                        
+            ! coefficients for schmidt number in degre Celcius
+            sca1(jn) =  3845.4 
+            sca2(jn) = -228.95
+            sca3(jn) = 6.1908 
+            sca4(jn) = -0.067430
+         ENDIF
+      ENDDO
+
+      DO jn = 1, jptra
+         WRITE(numout,*) 'coefficient for solubility of tracer',ctrcnm(jn)
+         WRITE(numout,*) soa1(jn), soa2(jn),soa3(jn), soa4(jn), &
+            &           sob1(jn), sob2(jn),sob3(jn)
+         WRITE(numout,*) 
+         WRITE(numout,*) 'coefficient for schmidt of tracer',ctrcnm(jn)
+         WRITE(numout,*) sca1(jn), sca2(jn),sca3(jn), sca4(jn)
+      END DO
+      !
+   END SUBROUTINE trc_freons_cst
+   
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                           No CFC model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_freons( kt )       ! Empty routine
+      WRITE(*,*) 'trc_freons: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_freons
+#endif
+
+   !!======================================================================
+END MODULE trcfreons
Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcini.cfc.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcini.cfc.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trcini.cfc.h90	(revision 764)
@@ -0,0 +1,124 @@
+   !!======================================================================
+   !!                         ***  trcini.cfc.h90  ***
+   !! TOP :   Initialisation of CFC chemical model
+   !!======================================================================
+   !! History :    -   !  2004-06  (JC. Dutay) Original code
+   !!             1.0  !  2005-03  (O. Aumont, A. El Moussaoui) F90
+   !!              -   !  2005-10  (C. Ethe) Modularity
+   !!----------------------------------------------------------------------
+
+   CHARACTER (len=34) ::   clname = 'cfc1112.atm' ! ???
+
+   INTEGER  ::   inum                   ! unit number
+   REAL(wp) ::   ylats = -10.           ! 10 degrees south
+   REAL(wp) ::   ylatn =  10.           ! 10 degrees north
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_ini
+      !!----------------------------------------------------------------------
+      !!                     ***  trcini.cfc.h90  ***  
+      !!
+      !! ** Purpose : special initialization for cfc model
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jn, jl, jm
+      REAL(wp) ::   zyy,  zyd
+      !!----------------------------------------------------------------------
+
+      ! Initialization of boundaries conditions
+      ! --------------------------------------- 
+      pp_cfc(:,:,:) = 0.e0
+      qtr   (:,:,:) = 0.e0
+      xphem (:,:)   = 0.e0
+      DO jn = 1, jptra
+         DO jm = 1, jphem
+            DO jl = 1, jpyear
+               p_cfc(jl,jm,jn) = 0.0
+            END DO
+         END DO
+      END DO
+      
+      
+      ! Initialization of qint in case of  no restart 
+      !----------------------------------------------
+      IF( .NOT. lrsttr ) THEN    
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero '
+         ENDIF
+         DO jn = 1, jptra
+            qint(:,:,jn) = 0.e0
+         END DO
+      ENDIF
+
+
+      !   READ CFC partial pressure atmospheric value :
+      !     p11(year,nt) = PCFC11  in northern (1) and southern (2) hemisphere 
+      !     p12(year,nt) = PCFC12  in northern (1) and southern (2) hemisphere 
+      !--------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm'
+      
+      CALL ctlopn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
+         &           1, numout, .FALSE., 1 )
+      REWIND(inum)
+      
+
+      ! Skip over 1st six descriptor lines
+      !-----------------------------------
+      DO jm = 1, 6
+         READ(inum,'(1x)')
+      END DO
+   
+   
+      !   Read file
+      ! ---------
+      DO jn = 31, 98
+         READ(inum,*) zyy, p_cfc(jn,1,jp11), p_cfc(jn,1,jp12), &
+            &              p_cfc(jn,2,jp11), p_cfc(jn,2,jp12)
+         WRITE(numout,'(f7.2, 4f8.2)' ) &
+            &         zyy, p_cfc(jn,1,jp11), p_cfc(jn,1,jp12), &
+            &              p_cfc(jn,2,jp11), p_cfc(jn,2,jp12)
+      END DO
+
+      p_cfc(32,1:2,jp11) = 5.e-4
+      p_cfc(33,1:2,jp11) = 8.e-4
+      p_cfc(34,1:2,jp11) = 1.e-6
+      p_cfc(35,1:2,jp11) = 2.e-3
+      p_cfc(36,1:2,jp11) = 4.e-3
+      p_cfc(37,1:2,jp11) = 6.e-3
+      p_cfc(38,1:2,jp11) = 8.e-3
+      p_cfc(39,1:2,jp11) = 1.e-2
+      
+      
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) ' Year   p11HN    p11HS    p12HN    p12HS '
+         DO jn = 30, 100
+            WRITE(numout, '( 1I4, 4F9.2)')   &
+               &         jn, p_cfc(jn,1,jp11), p_cfc(jn,2,jp11), &
+               &             p_cfc(jn,1,jp12), p_cfc(jn,2,jp12)
+         END DO
+      ENDIF
+
+
+      ! Interpolation factor of atmospheric partial pressure
+      ! Linear interpolation between 2 hemispheric function of latitud between ylats and ylatn
+      !---------------------------------------------------------------------------------------
+      zyd = ylatn - ylats      
+      DO jj = 1 , jpj
+         DO ji = 1 , jpi
+            IF(     gphit(ji,jj) >= ylatn ) THEN   ;   xphem(ji,jj) = 1.e0
+            ELSEIF( gphit(ji,jj) <= ylats ) THEN   ;   xphem(ji,jj) = 0.e0
+            ELSE                                   ;   xphem(ji,jj) = ( gphit(ji,jj) - ylats) / zyd
+            ENDIF
+         END DO
+      END DO
+      !
+   END SUBROUTINE trc_ini
Index: /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trclsm.cfc.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trclsm.cfc.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/CFC/trclsm.cfc.h90	(revision 764)
@@ -0,0 +1,52 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  trclsm.cfc.h90  ***  
+   !! TOP :   Definition some run parameter for CFC chemical model
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2003-08 (C. Ethe)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id $ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_lsm
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_lsm  ***
+      !!                 
+      !! ** Purpose :   Definition some run parameter for CFC model
+      !!
+      !! ** Method  :   Read the namcfc namelist and check the parameter 
+      !!       values called at the first timestep (nit000)
+      !!
+      !! ** input   :   Namelist namcfc
+      !!----------------------------------------------------------------------
+      CHARACTER (len=32) ::   clname = 'namelist.trc.sms'
+      INTEGER ::   numnat
+      !!
+      NAMELIST/namdates/ ndate_beg, nyear_res
+      !!-------------------------------------------------------------------
+
+      ndate_beg = 300101            ! default namelist value
+      nyear_res = 1950
+
+      !                             ! Open namelist file
+      CALL ctlopn( numnat, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
+         &           1, numout, .FALSE., 1 )
+         
+      READ( numnat , namdates )     ! read namelist
+
+      IF(lwp) THEN                  ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) ' trc_lsm: 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
+      ENDIF
+      nyear_beg = ndate_beg / 10000
+      IF(lwp) WRITE(numout,*) '    initial year (aa)                       nyear_beg = ', nyear_beg
+      !
+   END SUBROUTINE trc_lsm
Index: /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_interp.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_interp.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_interp.F90	(revision 764)
@@ -0,0 +1,16 @@
+MODULE agrif_top_interp
+   !!======================================================================
+   !!                   ***  MODULE agrif_top_interp  ***
+   !! TOP :   Dummy module when AGRIF is not used
+   !!======================================================================
+
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                               NO AGRIF
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
+   !!----------------------------------------------------------------------
+
+   !!======================================================================
+END MODULE agrif_top_interp
Index: /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_update.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_update.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/DUMMY/agrif_top_update.F90	(revision 764)
@@ -0,0 +1,16 @@
+MODULE agrif_top_update
+   !!======================================================================
+   !!                   ***  MODULE agrif_top_update  ***
+   !! TOP :   Dummy module when AGRIF is not used
+   !!======================================================================
+
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                               NO AGRIF
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
+   !!----------------------------------------------------------------------
+
+   !!======================================================================
+END MODULE agrif_top_update
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/par_sms_lobster1.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/par_sms_lobster1.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/par_sms_lobster1.h90	(revision 764)
@@ -0,0 +1,27 @@
+   !!---------------------------------------------------------------------
+   !!                     ***  par_sms_lobster1.h90  ***  
+   !! TOP :   CFC Source Minus Sink parameter for LOBSTER
+   !!---------------------------------------------------------------------
+   !! History :    -   !  1999-06  (M. Levy)  original code
+   !!              -   !  2000-12  (E. Kestenare) assign a parameter to name individual tracers
+   !!             1.0  !  2005-03  (C. Ethe) F90
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   INTEGER, PARAMETER ::   jpkb     = 12        !: top jk layers where biology is active
+   INTEGER, PARAMETER ::   jpkbm1   = jpkb - 1  !:
+
+   INTEGER, PARAMETER ::   jpdiabio = 15        !: number of biological trends
+      
+   INTEGER, PARAMETER ::   jpdet    = 1         !: detritus                    [mmoleN/m3]
+   INTEGER, PARAMETER ::   jpzoo    = 2         !: zooplancton concentration   [mmoleN/m3]
+   INTEGER, PARAMETER ::   jpphy    = 3         !: phytoplancton concentration [mmoleN/m3]
+   INTEGER, PARAMETER ::   jpno3    = 4         !: nitrate concentration       [mmoleN/m3]
+   INTEGER, PARAMETER ::   jpnh4    = 5         !: ammonium concentration      [mmoleN/m3]
+   INTEGER, PARAMETER ::   jpdom    = 6         !: dissolved organic matter    [mmoleN/m3]
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/sms_lobster1.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/sms_lobster1.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/sms_lobster1.h90	(revision 764)
@@ -0,0 +1,117 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  sms_lobster1.h90  ***  
+   !! TOP :   LOBSTER 1 Source Minus Sink valiables
+   !!----------------------------------------------------------------------
+   !! History :    -   !  1999-09 (M. Levy)  original code
+   !!              -   !  2000-12 (O. Aumont, E. Kestenare) add sediment 
+   !!             1.0  !  2005-10 (C. Ethe) F90
+   !!             1.0  !  2005-03  (A-S Kremeur) add fphylab, fzoolab, fdetlab, fdbod
+   !!              -   !  2005-06  (A-S Kremeur) add sedpocb, sedpocn, sedpoca
+   !!             2.0  !  2007-04  (C. Deltel, G. Madec) Free form and modules
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   !!  biological parameters
+   !! ----------------------
+   REAL(wp) ::   apmin    !: minimum phytoplancton concentration              (NAMELIST)
+   REAL(wp) ::   azmin    !: minimum zooplancton concentration                (NAMELIST)
+   REAL(wp) ::   anmin    !: minimum nutrients concentration                  (NAMELIST)
+   REAL(wp) ::   admin    !: minimum detritus concentration                   (NAMELIST)
+   REAL(wp) ::   redf     !: redfield ratio c:n                               (NAMELIST)
+   REAL(wp) ::   reddom   !: redfield ratio c:n for DOM                       
+   REAL(wp) ::   slopet   !: van t hoff coefficient                           (NAMELIST)
+   REAL(wp) ::   toptp    !: optimal photosynthesis temperature               (NAMELIST) 
+   REAL(wp) ::   aknut    !: half-saturation nutrient                         (NAMELIST)
+   REAL(wp) ::   psinut   !: inhibition of nitrate uptake by ammonium         (NAMELIST)
+   REAL(wp) ::   akno3    !: half-saturation for nitrate                      (NAMELIST)
+   REAL(wp) ::   aknh4    !: half-saturation for ammonium                     (NAMELIST)
+   REAL(wp) ::   rcchl    !: ???                                              
+   REAL(wp) ::   rgamma   !: phytoplankton exudation fraction                 (NAMELIST)
+   REAL(wp) ::   toptgz   !: optimal temperature for zooplankton growth       (NAMELIST)
+   REAL(wp) ::   tmaxgz   !: maximal temperature for zooplankton growth       (NAMELIST) 
+   REAL(wp) ::   rgz      !: widtht of zooplankton temperature FUNCTION       (NAMELIST)
+   REAL(wp) ::   rppz     !: zooplankton nominal preference for phytoplancton food (NAMELIST)
+   REAL(wp) ::   taus     !: maximum specific zooplankton grazing rate        (NAMELIST)
+   REAL(wp) ::   aks      !: half saturation constant for total zooplankton grazing (NAMELIST)
+   REAL(wp) ::   filmax   !: maximum mass clearance rate for zooplankton      (NAMELIST)
+   REAL(wp) ::   rpnaz    !: non-assimilated phytoplankton by zooplancton     (NAMELIST)
+   REAL(wp) ::   rdnaz    !: non-assimilated detritus by zooplankton          (NAMELIST) 
+   REAL(wp) ::   eggzoo   !: minimum for zooplankton concentration            (NAMELIST)
+   REAL(wp) ::   tauzn    !: zooplancton specific excretion rate              (NAMELIST)
+   REAL(wp) ::   tmmaxp   !: maximal phytoplancton mortality rate             (NAMELIST)
+   REAL(wp) ::   tmminp   !: minimal phytoplancton mortality rate             (NAMELIST)
+   REAL(wp) ::   tmmaxz   !: maximal zooplankton mortality rate               (NAMELIST)
+   REAL(wp) ::   tmminz   !: minimal zooplankton mortality rate               (NAMELIST)
+   REAL(wp) ::   anumin   !: nutrient threshold for phytoplankton mortality   (NAMELIST)
+   REAL(wp) ::   afdmin   !: food threshold for zooplankton mortality         (NAMELIST)
+   REAL(wp) ::   taudn    !: detrital breakdown rate                          (NAMELIST)
+   REAL(wp) ::   vsed     !: sedimentation speed                              (NAMELIST)
+   REAL(wp) ::   tmumax   !: maximal phytoplankton growth rate                (NAMELIST)
+   REAL(wp) ::   aki      !: light photosynthesis half saturation constant    (NAMELIST)
+   REAL(wp) ::   tmaxr    !: maximum coefficient for passive tracer damping   (NAMELIST)
+   REAL(wp) ::   tminr    !: minimum coefficient for passive tracer damping   (NAMELIST)
+   REAL(wp) ::   fdoml    !: fraction of exsudation that goes to nh4 (should be labile dom)
+   REAL(wp) ::   taunn    !: nitrification rate
+   REAL(wp) ::   taudomn  !: slow remineralization rate of semi-labile dom to nh4
+   REAL(wp) ::   xhr      !: coeff for Martin's remineralistion profile
+   REAL(wp) ::   fphylab  !: NH4 fraction of phytoplankton excretion
+   REAL(wp) ::   fzoolab  !: NH4 fraction of zooplankton excretion
+   REAL(wp) ::   fdetlab  !: NH4 fraction of detritus dissolution
+   REAL(wp) ::   fdbod    !: zooplankton mortality fraction that goes to detritus
+
+   REAL(wp), DIMENSION(jpk,jptra) ::   remdmp   !: depth dependant damping coefficient of passive tracers 
+   
+
+# if defined key_trc_diabio
+
+   !! Biological trends 
+   !! -----------------
+   CHARACTER(len=8),  DIMENSION(jpdiabio) ::   ctrbio   !: biological trends name      (NAMELIST)
+   CHARACTER(len=20), DIMENSION(jpdiabio) ::   ctrbiu   !: biological trends unit      (NAMELIST)
+   CHARACTER(len=80), DIMENSION(jpdiabio) ::   ctrbil   !: biological trends long name (NAMELIST)
+   REAL(wp), DIMENSION(jpi,jpj,jpk,jpdiabio) :: trbio   !: biological trends
+
+   !! Netcdf output parameters
+   !! ------------------------
+   INTEGER ::   nwritebio   !: time step frequency for biological outputs (NAMELIST)
+   INTEGER ::   nitb        !:         id.         for additional array output file
+   INTEGER ::   ndepitb     !:         id.         for depth mesh
+   INTEGER ::   nhoritb     !:         id.         for horizontal mesh
+
+# endif 
+
+   !! Optical parameters                                
+   !! ------------------                                
+   REAL(wp) ::   xkr0       !: water coefficient absorption in red      (NAMELIST)
+   REAL(wp) ::   xkg0       !: water coefficient absorption in green    (NAMELIST)
+   REAL(wp) ::   xkrp       !: pigment coefficient absorption in red    (NAMELIST)
+   REAL(wp) ::   xkgp       !: pigment coefficient absorption in green  (NAMELIST)
+   REAL(wp) ::   xlr        !: exposant for pigment absorption in red   (NAMELIST)
+   REAL(wp) ::   xlg        !: exposant for pigment absorption in green (NAMELIST)
+   REAL(wp) ::   rpig       !: chla/chla+phea ratio                     (NAMELIST)
+                                                        
+   INTEGER , DIMENSION(jpi,jpj)     ::   neln    !: number of levels in the euphotic layer
+   REAL(wp), DIMENSION(jpi,jpj)     ::   xze     !: euphotic layer depth
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xpar    !: par (photosynthetic available radiation)
+
+   !! Sediment parameters                               
+   !! -------------------                               
+   REAL(wp) ::   sedlam       !: time coefficient of POC remineralization in sediments
+   REAL(wp) ::   sedlostpoc   !: ???
+   REAL(wp) ::   areacot      !: ???
+                                                        
+   REAL(wp), DIMENSION(jpi,jpj)     ::   dminl   !: fraction of sinking POC released in sediments
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   dmin3   !: fraction of sinking POC released at each level
+                                                        
+   REAL(wp), DIMENSION(jpi,jpj) ::   sedpocb     !: mass of POC in sediments
+   REAL(wp), DIMENSION(jpi,jpj) ::   sedpocn     !: mass of POC in sediments
+   REAL(wp), DIMENSION(jpi,jpj) ::   sedpoca     !: mass of POC in sediments
+                                                        
+   REAL(wp), DIMENSION(jpi,jpj) ::   fbod        !: rapid sinking particles
+   REAL(wp), DIMENSION(jpi,jpj) ::   cmask       !: ???
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcbio.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcbio.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcbio.F	(revision 764)
@@ -0,0 +1,555 @@
+
+CCC $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/trcbio.F,v 1.9 2007/10/12 09:36:28 opalod Exp $ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+      SUBROUTINE trcbio(kt)
+#if defined key_passivetrc && defined key_trc_lobster1
+CCC---------------------------------------------------------------------
+CCC
+CCC                       ROUTINE trcbio
+CCC                     *******************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC     compute the now trend due to biogeochemical processes
+CCC     and add it to the general trend of passive tracers equations.
+CCC
+CCC	Three options:
+CCC  	  Default option  : no biological trend
+CCC       IF 'key_trc_lobster1' : LOBSTER1 model
+CCC
+CC   METHOD :
+CC   -------
+CC      each now biological flux is calculated  in FUNCTION of now
+CC      concentrations of tracers.
+CC      depending on the tracer, these fluxes are sources or sinks.
+CC      the total of the sources and sinks for each tracer
+CC      is added to the general trend.
+CC
+CC		tra = tra + zf...tra - zftra...
+CC                             |         |
+CC                             |         |
+CC                          source      sink
+CC
+CC
+CC      IF 'key_trc_diabio' key is activated, the biogeochemical
+CC	trends for passive tracers are saved for futher diagnostics.
+CC
+CC      multitasked on vertical slab (jj-loop)
+CC
+CC   -----
+CC      argument
+CC              ktask           : task identificator
+CC              kt              : time step
+CC      COMMON
+CC            /comcoo/          : orthogonal curvilinear coordinates
+CC                                and scale factors
+CC                                depths
+CC            /cottrp/          : present and next fields for passive
+CC                              : tracers
+CC            /comtsk/          : multitasking
+CC            /comtke/          : emin, en()
+CC            /cotbio/          : biological parameters
+CC
+CC   OUTPUT :
+CC   ------
+CC      COMMON
+CC            /cottrp/ tra      : general tracer trend increased by the
+CC                                now horizontal tracer advection trend
+CC            /cottbd/ trbio    : now horizontal tracer advection trend
+CC                                (IF 'key_trc_diabio' is activated)
+CC
+CC   WORKSPACE :
+CC   ---------
+CC      local
+CC               zdet,zzoo,zphy,znh4,zno3,zdom    : now concentrations
+CC               zlt,zlno3,zlnh4,zle              : limitation terms for phyto
+CC               zfno3phy and so on..             : fluxes between bio boxes
+CC               zphya,zzooa,zdeta, ...           : after bio trends
+CC               zppz, zpdz, zpppz, zppdz, zfood  : preferences terms
+CC               zfilpz, zfilpd                   : filtration terms
+CC      COMMON
+CC
+CC   EXTERNAL :                   no
+CC   --------
+CC
+CC   REFERENCES :                 no
+CC   ----------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC       original : 99-07 (M. Levy)
+CC                  00-12 (E. Kestenare): assign a parameter 
+CC                                        to name individual tracers
+CC                  01-03 (M. Levy) LNO3 + dia2d
+CC----------------------------------------------------------------------
+CC----------------------------------------------------------------------
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      USE lbclnk
+      IMPLICIT NONE
+CC local declarations
+CC ==================
+      INTEGER kt
+      INTEGER ji,jj,jk,jn
+      REAL ztot(jpi)
+#if defined key_trc_diaadd
+      REAL ze3t(jpi,jpj,jpk)
+#endif
+      REAL zdet,zzoo,zphy,zno3,znh4,zdom,zlno3,zlnh4,zle,zlt
+      REAL zno3phy, znh4phy, zphynh4, zphydom, zphydet, zphyzoo, zdetzoo
+     $    ,zzoonh4, zzoodom, zzoodet, zdetnh4, zdetdom, znh4no3, zdomnh4
+     $    ,zppz,zpdz,zpppz,zppdz,zfood,zfilpz,zfildz,zphya,zzooa,zno3a
+     $    ,znh4a,zdeta,zdoma, ztra, zzoobod, zboddet, zdomaju
+
+CC----------------------------------------------------------------------
+CC statement functions
+CC ===================
+CDIR$ NOLIST
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CCC---------------------------------------------------------------------
+CCC  OPA8, LODYC (07/99)
+CCC---------------------------------------------------------------------
+C   | --------------|
+C   | LOBSTER1 MODEL| 
+C   | --------------|
+
+#if defined key_trc_diaadd
+C convert fluxes in per day
+      ze3t(:,:,:) = 0.
+      DO jk=1,jpkbm1
+        DO jj = 2, jpjm1
+          DO ji = 2, jpim1
+            ze3t(ji,jj,jk)=fse3t(ji,jj,jk)*86400.
+          END DO
+        END DO
+      END DO 
+#endif
+C
+C vertical slab
+C =============
+C
+      DO 1000 jj = 2,jpjm1
+C
+C 1. biological level
+C ===================
+C
+        DO ji = 2,jpim1
+          fbod(ji,jj)=0.
+#if defined key_trc_diaadd
+          DO jn=1,jpdia2d
+            trc2d(ji,jj,jn)=0.          
+          END DO 
+#endif
+        END DO 
+
+        DO jk=1,jpkbm1
+          DO ji = 2,jpim1
+C
+C
+C 1.1 trophic variables( det, zoo, phy, no3, nh4, dom)
+C ---------------------------------------------------
+C
+C negative trophic variables DO not contribute to the fluxes
+C
+            zdet = max(0.,trn(ji,jj,jk,jpdet))
+            zzoo = max(0.,trn(ji,jj,jk,jpzoo))
+            zphy = max(0.,trn(ji,jj,jk,jpphy))
+            zno3 = max(0.,trn(ji,jj,jk,jpno3))
+            znh4 = max(0.,trn(ji,jj,jk,jpnh4))
+            zdom = max(0.,trn(ji,jj,jk,jpdom))
+C
+C
+C 1.2  Limitations
+C ----------------
+C
+            zlt = 1.
+            zle = 1. - exp( -xpar(ji,jj,jk)/aki/zlt)
+C psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03
+            zlno3 = zno3* exp(-psinut*znh4) / (akno3+zno3)
+            zlnh4 = znh4 / (znh4+aknh4) 
+
+C
+C
+C 1.3 sinks and sources
+C ---------------------
+C
+C
+C 1. phytoplankton production and exsudation
+C
+            zno3phy = tmumax * zle * zlt * zlno3 * zphy
+            znh4phy = tmumax * zle * zlt * zlnh4 * zphy
+
+C fphylab added by asklod AS Kremeur 2005-03
+            zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy)
+            zphynh4 = rgamma * fphylab * (zno3phy + znh4phy)
+
+C
+C 2. zooplankton production
+C
+C preferences
+C
+            zppz = rppz
+            zpdz = 1. - rppz
+            zpppz = ( zppz * zphy ) /
+     $          ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
+            zppdz = ( zpdz * zdet ) /
+     $          ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
+            zfood = zpppz * zphy + zppdz * zdet
+C
+C filtration
+C
+            zfilpz = taus * zpppz / (aks + zfood)
+            zfildz = taus * zppdz / (aks + zfood)
+C
+C grazing
+C
+            zphyzoo = zfilpz * zphy * zzoo
+            zdetzoo = zfildz * zdet * zzoo
+C
+C 3. fecal pellets production
+C
+            zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo
+C
+C 4. zooplankton liquide excretion
+C
+            zzoonh4 = tauzn * fzoolab * zzoo 
+            zzoodom = tauzn * (1 - fzoolab) * zzoo
+C
+C 5. mortality
+C
+C phytoplankton mortality 
+C
+            zphydet = tmminp * zphy
+C
+C
+C zooplankton mortality
+c closure : flux fbod is redistributed below level jpkbio
+C
+            zzoobod = tmminz * zzoo * zzoo
+            fbod(ji,jj) = fbod(ji,jj) 
+     $                 + (1-fdbod) * zzoobod * fse3t(ji,jj,jk)
+            zboddet = fdbod * zzoobod
+C
+C
+C 6. detritus and dom breakdown
+C
+C
+            zdetnh4 = taudn * fdetlab * zdet
+            zdetdom = taudn * (1 - fdetlab) * zdet 
+
+            zdomnh4 = taudomn * zdom
+C
+C flux added to express how the excess of nitrogen from
+C PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment)
+            zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
+C
+C 7. Nitrification
+C
+            znh4no3 = taunn * znh4
+C
+C
+C
+C 1.4 determination of trends
+C ---------------------------
+C
+C total trend for each biological tracer
+C
+            zphya =   zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo
+     $          - zphydet
+            zzooa =   zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4
+     $          - zzoobod
+            zno3a = - zno3phy + znh4no3
+            znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4
+     $          + zdetnh4 + zdomaju
+            zdeta = zphydet + zzoodet  - zdetzoo - zdetnh4 - zdetdom +
+     $          zboddet
+            zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
+C
+#if defined key_trc_diabio
+            trbio(ji,jj,jk,1) = zno3phy
+            trbio(ji,jj,jk,2) = znh4phy
+            trbio(ji,jj,jk,3) = zphynh4
+            trbio(ji,jj,jk,4) = zphydom
+            trbio(ji,jj,jk,5) = zphyzoo
+            trbio(ji,jj,jk,6) = zphydet
+            trbio(ji,jj,jk,7) = zdetzoo
+            trbio(ji,jj,jk,9) = zzoodet
+            trbio(ji,jj,jk,10) = zzoobod
+            trbio(ji,jj,jk,11) = zzoonh4
+            trbio(ji,jj,jk,12) = zzoodom
+            trbio(ji,jj,jk,13) = znh4no3
+            trbio(ji,jj,jk,14) = zdomnh4
+            trbio(ji,jj,jk,15) = zdetnh4
+#endif
+#if defined key_trc_diaadd
+            trc2d(ji,jj,1)=trc2d(ji,jj,1)+zno3phy*ze3t(ji,jj,jk)          
+            trc2d(ji,jj,2)=trc2d(ji,jj,2)+znh4phy*ze3t(ji,jj,jk)
+            trc2d(ji,jj,3)=trc2d(ji,jj,3)+zphydom*ze3t(ji,jj,jk)
+            trc2d(ji,jj,4)=trc2d(ji,jj,4)+zphynh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,5)=trc2d(ji,jj,5)+zphyzoo*ze3t(ji,jj,jk)
+            trc2d(ji,jj,6)=trc2d(ji,jj,6)+zphydet*ze3t(ji,jj,jk)
+            trc2d(ji,jj,7)=trc2d(ji,jj,7)+zdetzoo*ze3t(ji,jj,jk)
+c trend number 8 is in trcsed.F            
+            trc2d(ji,jj,9)=trc2d(ji,jj,9)+zzoodet*ze3t(ji,jj,jk)
+            trc2d(ji,jj,10)=trc2d(ji,jj,10)+zzoobod*ze3t(ji,jj,jk)
+            trc2d(ji,jj,11)=trc2d(ji,jj,11)+zzoonh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,12)=trc2d(ji,jj,12)+zzoodom*ze3t(ji,jj,jk)
+            trc2d(ji,jj,13)=trc2d(ji,jj,13)+znh4no3*ze3t(ji,jj,jk)
+            trc2d(ji,jj,14)=trc2d(ji,jj,14)+zdomnh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,15)=trc2d(ji,jj,15)+zdetnh4*ze3t(ji,jj,jk)
+             
+            trc2d(ji,jj,16)=trc2d(ji,jj,16)+(zno3phy+znh4phy-zphynh4
+     $          -zphydom-zphyzoo-zphydet)*ze3t(ji,jj,jk)
+            trc2d(ji,jj,17)=trc2d(ji,jj,17)+(zphyzoo+zdetzoo-zzoodet
+     $          -zzoobod-zzoonh4-zzoodom) *ze3t(ji,jj,jk)
+            trc2d(ji,jj,18)=trc2d(ji,jj,18)+zdetdom*ze3t(ji,jj,jk)
+c trend number 19 is in trcexp.F
+            trc3d(ji,jj,jk,1)= zno3phy *86400     
+            trc3d(ji,jj,jk,2)= znh4phy *86400     
+            trc3d(ji,jj,jk,3)= znh4no3 *86400     
+#endif
+C
+C tracer flux at totox-point added to the general trend
+C
+            tra(ji,jj,jk,jpdet) = tra(ji,jj,jk,jpdet) + zdeta
+            tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) + zzooa
+            tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zphya
+            tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zno3a
+            tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + znh4a
+            tra(ji,jj,jk,jpdom) = tra(ji,jj,jk,jpdom) + zdoma
+C
+          END DO
+        END DO
+C
+C 2. under biological level
+C =========================
+C
+        DO jk = jpkb,jpk
+C
+C 2.1 compute the remineralisation of all quantities towards nitrate 
+C ------------------------------------------------------------------
+C
+          DO ji = 2,jpim1
+C
+C 2.1.1 trophic variables( det, zoo, phy, no3, nh4, dom)
+C -----------------------------------------------------
+C
+C negative trophic variables DO not contribute to the fluxes
+C
+            zdet = max(0.,trn(ji,jj,jk,jpdet))
+            zzoo = max(0.,trn(ji,jj,jk,jpzoo))
+            zphy = max(0.,trn(ji,jj,jk,jpphy))
+            zno3 = max(0.,trn(ji,jj,jk,jpno3))
+            znh4 = max(0.,trn(ji,jj,jk,jpnh4))
+            zdom = max(0.,trn(ji,jj,jk,jpdom))
+CC
+CC 2.1.2  Limitations
+CC ----------------
+CC
+            zlt = 0.
+            zle = 0.
+            zlno3 = 0.
+            zlnh4 = 0.
+CC
+CC
+CC 2.1.3 sinks and sources
+CC ---------------------
+CC
+CC
+CC 1. phytoplankton production and exsudation
+CC
+            zno3phy = 0.
+            znh4phy = 0.
+C
+            zphydom = 0.
+            zphynh4 = 0.
+CC
+CC 2. zooplankton production
+CC
+CC grazing
+CC
+            zphyzoo = 0. 
+            zdetzoo = 0.
+CC
+CC 3. fecal pellets production
+CC
+            zzoodet = 0.
+CC
+CC 4. zooplankton liquide excretion
+CC
+            zzoonh4 = tauzn * fzoolab * zzoo 
+            zzoodom = tauzn * (1 - fzoolab) * zzoo
+CC
+CC 5. mortality
+CC
+CC phytoplankton mortality 
+CC
+            zphydet = tmminp * zphy
+CC
+CC
+CC zooplankton mortality
+Cc closure : flux fbod is redistributed below level jpkbio
+CC
+            zzoobod = 0.
+            zboddet = 0. 
+CC
+CC
+CC 6. detritus and dom breakdown
+CC
+            zdetnh4 = taudn * fdetlab * zdet
+            zdetdom = taudn * (1 - fdetlab) * zdet 
+C
+            zdomnh4 = taudomn * zdom
+            zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
+CC
+CC 7. Nitrification
+CC
+            znh4no3 = taunn * znh4
+CC
+CC
+CC 2.1.4 determination of trends
+CC ---------------------------
+CC
+CC total trend for each biological tracer
+CC
+            zphya =   zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo
+     $          - zphydet
+            zzooa =   zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4
+     $          - zzoobod
+            zno3a = - zno3phy + znh4no3
+            znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4
+     $          + zdetnh4 + zdomaju
+            zdeta = zphydet + zzoodet  - zdetzoo - zdetnh4 - zdetdom +
+     $          zboddet
+            zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
+CC
+#if defined key_trc_diabio
+            trbio(ji,jj,jk,1) = zno3phy
+            trbio(ji,jj,jk,2) = znh4phy
+            trbio(ji,jj,jk,3) = zphynh4
+            trbio(ji,jj,jk,4) = zphydom
+            trbio(ji,jj,jk,5) = zphyzoo
+            trbio(ji,jj,jk,6) = zphydet
+            trbio(ji,jj,jk,7) = zdetzoo
+            trbio(ji,jj,jk,9) = zzoodet
+            trbio(ji,jj,jk,10) = zzoobod
+            trbio(ji,jj,jk,11) = zzoonh4
+            trbio(ji,jj,jk,12) = zzoodom
+            trbio(ji,jj,jk,13) = znh4no3
+            trbio(ji,jj,jk,14) = zdomnh4
+            trbio(ji,jj,jk,15) = zdetnh4
+#endif
+#if defined key_trc_diaadd
+            trc2d(ji,jj,1)=trc2d(ji,jj,1)+zno3phy*ze3t(ji,jj,jk)          
+            trc2d(ji,jj,2)=trc2d(ji,jj,2)+znh4phy*ze3t(ji,jj,jk)
+            trc2d(ji,jj,3)=trc2d(ji,jj,3)+zphydom*ze3t(ji,jj,jk)
+            trc2d(ji,jj,4)=trc2d(ji,jj,4)+zphynh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,5)=trc2d(ji,jj,5)+zphyzoo*ze3t(ji,jj,jk)
+            trc2d(ji,jj,6)=trc2d(ji,jj,6)+zphydet*ze3t(ji,jj,jk)
+            trc2d(ji,jj,7)=trc2d(ji,jj,7)+zdetzoo*ze3t(ji,jj,jk)
+Cc trend number 8 is in trcsed.F            
+            trc2d(ji,jj,9)=trc2d(ji,jj,9)+zzoodet*ze3t(ji,jj,jk)
+            trc2d(ji,jj,10)=trc2d(ji,jj,10)+zzoobod*ze3t(ji,jj,jk)
+            trc2d(ji,jj,11)=trc2d(ji,jj,11)+zzoonh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,12)=trc2d(ji,jj,12)+zzoodom*ze3t(ji,jj,jk)
+            trc2d(ji,jj,13)=trc2d(ji,jj,13)+znh4no3*ze3t(ji,jj,jk)
+            trc2d(ji,jj,14)=trc2d(ji,jj,14)+zdomnh4*ze3t(ji,jj,jk)
+            trc2d(ji,jj,15)=trc2d(ji,jj,15)+zdetnh4*ze3t(ji,jj,jk)
+             
+            trc2d(ji,jj,16)=trc2d(ji,jj,16)+(zno3phy+znh4phy-zphynh4
+     $          -zphydom-zphyzoo-zphydet)*ze3t(ji,jj,jk)
+            trc2d(ji,jj,17)=trc2d(ji,jj,17)+(zphyzoo+zdetzoo-zzoodet
+     $          -zzoobod-zzoonh4-zzoodom) *ze3t(ji,jj,jk)
+            trc2d(ji,jj,18)=trc2d(ji,jj,18)+zdetdom*ze3t(ji,jj,jk)
+
+            trc3d(ji,jj,jk,1)= zno3phy *86400     
+            trc3d(ji,jj,jk,2)= znh4phy *86400     
+            trc3d(ji,jj,jk,3)= znh4no3 *86400     
+#endif
+CC
+CC tracer flux at totox-point added to the general trend
+CC
+            tra(ji,jj,jk,jpdet) = tra(ji,jj,jk,jpdet) + zdeta
+            tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) + zzooa
+            tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zphya
+            tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zno3a
+            tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + znh4a
+            tra(ji,jj,jk,jpdom) = tra(ji,jj,jk,jpdom) + zdoma
+CC
+          END DO
+        END DO
+
+
+
+
+c$$$        DO jk = jpkb,jpk
+c$$$C
+c$$$C 2.1 Old way to compute the remineralisation : asklod AS Kremeur (before 2005-03)
+c$$$C ------------------------------------------------------------------
+c$$$C
+c$$$          DO ji=2,jpim1
+c$$$            ztot(ji) = 0.
+c$$$          END DO 
+c$$$          DO jn=1,jptra
+c$$$            IF (ctrcnm(jn).NE.'NO3') THEN 
+c$$$                DO ji=2,jpim1
+c$$$                  ztra = remdmp(jk,jn) * trn(ji,jj,jk,jn) 
+c$$$                  tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) - ztra
+c$$$                  ztot(ji) = ztot(ji) + ztra
+c$$$                END DO 
+c$$$            ENDIF
+c$$$          END DO 
+c$$$          DO jn=1,jptra
+c$$$            IF (ctrcnm(jn).EQ.'NO3') THEN 
+c$$$                DO ji=2,jpim1
+c$$$                  tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztot(ji)
+c$$$                END DO
+c$$$#if defined key_trc_diabio
+c$$$                trbio(ji,jj,jk,1)=ztot(ji)
+c$$$#endif 
+c$$$            ENDIF
+c$$$          END DO
+c$$$        END DO 
+
+C
+C
+C END of slab
+C ===========
+C
+ 1000 CONTINUE
+
+#if defined key_trc_diaadd
+
+C Lateral boundary conditions on trc2d
+      DO jn=1,jpdia2d
+          CALL lbc_lnk(trc2d(:,:,jn),'T',1. )
+      END DO 
+
+C Lateral boundary conditions on trc3d
+      DO jn=1,jpdia3d
+          CALL lbc_lnk(trc3d(:,:,1,jn),'T',1. )
+      END DO 
+
+#endif
+
+#if defined key_trc_diabio
+C Lateral boundary conditions on trcbio
+      DO jn=1,jpdiabio
+          CALL lbc_lnk(trbio(:,:,1,jn),'T',1. )
+      END DO 
+#endif
+
+#  else
+C
+C    no biological model
+C
+#  endif
+
+C
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcctl.lobster1.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcctl.lobster1.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcctl.lobster1.h90	(revision 764)
@@ -0,0 +1,75 @@
+   !!======================================================================
+   !!                         ***  trcctl.lobster1.h90  ***
+   !! TOP :   Control of LOBSTER 1 biological model
+   !!======================================================================
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2000-12 (E. Kestenare) assign a parameter to name individual tracers
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' use LOBSTER1 biological model '
+
+      ! Check number of tracers
+      ! -----------------------
+      IF (jptra /= 6) THEN 
+          IF (lwp) THEN 
+              WRITE (numout,*) ' ===>>>> : w a r n i n g '
+              WRITE (numout,*) ' =======   ============= '
+              WRITE (numout,*)                             &
+              &   ' STOP, change jptra to 6 in '           &
+              &   ,'parameter.passivetrc.lobster1.h '  
+          END IF 
+          STOP 'TRC_CTL'
+      END IF 
+
+      ! Check tracer names
+      ! ------------------
+      IF(   ctrcnm(jpdet) /= 'DET' .OR. ctrcnm(jpzoo) /= 'ZOO' .OR.   &
+         &  ctrcnm(jpphy) /= 'PHY' .OR. ctrcnm(jpno3) /= 'NO3' .OR.   &
+         &  ctrcnm(jpnh4) /= 'NH4' .OR. ctrcnm(jpdom) /= 'DOM' .OR.   & 
+         &  ctrcnl(jpdet) /= 'Detritus'                        .OR.   &
+         &  ctrcnl(jpzoo) /= 'Zooplankton concentration'       .OR.   &
+         &  ctrcnl(jpphy) /= 'Phytoplankton concentration'     .OR.   &
+         &  ctrcnl(jpno3) /= 'Nitrate concentration'           .OR.   &
+         &  ctrcnl(jpnh4) /= 'Ammonium concentration'          .OR.   &
+         &  ctrcnl(jpdom) /= 'Dissolved organic matter' ) THEN 
+         ctrcnm(jpdet)='DET'
+         ctrcnl(jpdet)='Detritus'
+         ctrcnm(jpzoo)='ZOO'
+         ctrcnl(jpzoo)='Zooplankton concentration'
+         ctrcnm(jpphy)='PHY'
+         ctrcnl(jpphy)='Phytoplankton concentration'
+         ctrcnm(jpno3)='NO3'
+         ctrcnl(jpno3)='Nitrate concentration'
+         ctrcnm(jpnh4)='NH4'
+         ctrcnl(jpnh4)='Ammonium concentration'
+         ctrcnm(jpdom)='DOM'
+         ctrcnl(jpdom)='Dissolved organic matter'          
+         IF(lwp) THEN
+            WRITE (numout,*) ' ===>>>> : w a r n i n g '
+            WRITE (numout,*) ' =======   ============= '
+            WRITE (numout,*) ' we force tracer names'
+            DO jn = 1, jptra
+               WRITE(numout,*) ' tracer nb: ',jn,' name = ',ctrcnm(jn), ctrcnl(jn)
+            END DO
+            WRITE(numout,*) ' '
+         ENDIF 
+      ENDIF 
+
+      ! Check tracer units
+      DO jn = 1, jptra
+         IF( ctrcun(jn) /= 'mmole-N/m3') THEN
+            ctrcun(jn)='mmole-N/m3'
+            IF(lwp) THEN
+               WRITE (numout,*) ' ===>>>> : w a r n i n g '
+               WRITE (numout,*) ' =======   ============= '
+               WRITE (numout,*) ' we force tracer unit'
+               WRITE(numout,*) ' tracer  ',ctrcnm(jn), 'UNIT= ',ctrcun(jn)
+            ENDIF 
+         ENDIF 
+      END DO              
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcexp.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcexp.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcexp.F	(revision 764)
@@ -0,0 +1,192 @@
+CCC $Header$ 
+      SUBROUTINE trcexp(kt)
+#if defined key_passivetrc && defined key_trc_lobster1 
+CCC---------------------------------------------------------------------
+CCC
+CCC                       ROUTINE trcexp
+CCC                     ******************
+CCC
+CC
+CC     PURPOSE.
+CC     --------
+CC          *TRCEXP* MODELS EXPORT OF BIOGENIC MATTER (POC ''SOFT
+CC                   TISSUE'') AND ITS DISTRIBUTION IN WATER COLUMN
+CC
+CC     METHOD.
+CC     -------
+CC          IN THE SURFACE LAYER POC IS PRODUCED ACCORDING TO
+CC     NURTRIENTS AVAILABLE AND GROWTH CONDITIONS. NUTRIENT UPTAKE
+CC     KINETICS FOLLOW MICHAELIS-MENTON FORMULATION. 
+CC     THE TOTAL PARTICLE AMOUNT PRODUCED, IS DISTRIBUTED IN THE WATER
+CC     COLUMN BELOW THE SURFACE LAYER.
+CC
+CC     EXTERNALS.
+CC     ----------
+CC          NONE.
+CC
+CC     REFERENCE.
+CC     ----------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original      : 1999    O. Aumont
+CC      modifications : 1999    C. Le Quere
+CC      additions   : 01-05 (O. Aumont, E. Kestenare):
+CC                           add sediment computations
+CC                  :  05-06  (AS. Kremeur) new temporal integration for sedpoc
+CC ---------------------------------------------------------------------
+c ------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      USE lbclnk
+      USE trc
+      USE trctrp_lec
+
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER kt
+      INTEGER ji, jj, jk, zkbot(jpi,jpj)
+      REAL zwork(jpi,jpj), zgeolpoc, zfact
+CC----------------------------------------------------------------------
+CC statement functions
+CC ===================
+CDIR$ NOLIST
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+C
+C VERTICAL DISTRIBUTION OF NEWLY PRODUCED BIOGENIC
+C POC IN THE WATER COLUMN
+C (PARTS OF NEWLY FORMED MATTER REMAINING IN THE DIFFERENT
+C LAYERS IS DETERMINED BY DMIN3 DEFINED IN common.passivetrc.*.h
+C ----------------------------------------------------------------------
+C
+C
+      DO jk = 1,jpkm1
+        DO jj = 2,jpjm1
+          DO ji = 2,jpim1
+            tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3)+
+     &          (1./fse3t(ji,jj,jk))*
+     &          dmin3(ji,jj,jk) *fbod(ji,jj)
+          ENDDO
+        ENDDO
+      ENDDO
+C
+C     Find the last level of the water column
+C     Compute fluxes due to sinking particles (slow)
+C   
+      zkbot = jpk
+      zwork = 0.
+C
+C
+      DO jk = 1,jpkm1
+        DO jj = 2,jpjm1
+          DO ji = 2,jpim1
+   
+             IF ( tmask(ji,jj,jk) .eq. 1 .and.
+     .            tmask(ji,jj,jk+1). eq. 0 ) THEN
+                  zkbot(ji,jj) = jk
+                  zwork(ji,jj) = vsed * trn(ji,jj,jk,jpdet)
+              ENDIF
+    
+             ENDDO
+         ENDDO
+      ENDDO
+C
+C     Initialization
+      zgeolpoc = 0.
+
+C     Release of nutrients from the "simple" sediment
+C
+        DO jj = 2,jpjm1
+          DO ji = 2,jpim1
+             tra(ji,jj,zkbot(ji,jj),jpno3) = 
+     .          tra(ji,jj,zkbot(ji,jj),jpno3) +
+     .               sedlam*sedpocn(ji,jj)/fse3t(ji,jj,zkbot(ji,jj))
+
+C     Deposition of organic matter in the sediment
+C
+             zgeolpoc = zgeolpoc + sedlostpoc*sedpocn(ji,jj)*
+     .                             e1t(ji,jj)*e2t(ji,jj)
+
+             sedpoca(ji,jj) = zwork(ji,jj)*rdt +
+     .                       dminl(ji,jj)*fbod(ji,jj)*rdt -
+     .                       sedlam*sedpocn(ji,jj)*rdt -
+     .                       sedlostpoc*sedpocn(ji,jj)*rdt
+C
+             ENDDO
+         ENDDO
+C
+        DO jj = 2,jpjm1
+          DO ji = 2,jpim1
+             tra(ji,jj,1,jpno3) = tra(ji,jj,1,jpno3) + zgeolpoc*
+     .                            cmask(ji,jj)/areacot/fse3t(ji,jj,1)
+           ENDDO
+         ENDDO
+
+         CALL lbc_lnk( sedpocn, 'T', 1. )
+ 
+C Oa & Ek: diagnostics depending on jpdia2d
+C          left as example
+#     if defined key_trc_diaadd
+           do jj=1,jpj
+             do ji=1,jpi
+              trc2d(ji,jj,19)=sedpocn(ji,jj)
+             end do
+           end do
+#     endif
+
+c      ! 1. Leap-frog scheme (only in explicit case, otherwise the 
+c      ! -------------------  time stepping is already done in trczdf)
+       IF(l_trczdf_exp .AND. (ln_trcadv_cen2 .OR. ln_trcadv_tvd)) THEN
+         zfact = 2. * rdttra(jk) * FLOAT(ndttrc) 
+         IF( neuler == 0 .AND. kt == nittrc000 ) 
+     .     zfact = rdttra(jk) * FLOAT(ndttrc) 
+         sedpoca(:,:) = ( sedpocb(:,:) + zfact * sedpoca(:,:) )
+      ENDIF
+
+      
+c      ! 2. Time filter and swap of arrays
+c      ! ---------------------------------
+      IF ( ln_trcadv_cen2 .OR. ln_trcadv_tvd  ) THEN         
+          IF( neuler == 0 .AND. kt == nittrc000 ) THEN
+              DO jj = 1, jpj
+                DO ji = 1, jpi
+                  sedpocb(ji,jj) = sedpocn(ji,jj)
+                  sedpocn(ji,jj) = sedpoca(ji,jj)
+                  sedpoca(ji,jj) = 0.
+                END DO
+              END DO
+         ELSE
+             DO jj = 1, jpj
+               DO ji = 1, jpi
+                 sedpocb(ji,jj) = atfp*(sedpocb(ji,jj)+sedpoca(ji,jj)) 
+     .                          + atfp1 * sedpocn(ji,jj)
+                 sedpocn(ji,jj) = sedpoca(ji,jj)
+                 sedpoca(ji,jj) = 0.
+               END DO
+             END DO
+         ENDIF
+         
+      ELSE
+c         !  case of smolar scheme or muscl
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               sedpocb(ji,jj) = sedpoca(ji,jj)
+               sedpocn(ji,jj) = sedpoca(ji,jj)
+               sedpoca(ji,jj) = 0.
+            END DO
+         END DO
+         
+      ENDIF
+
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcini.lobster1.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcini.lobster1.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcini.lobster1.h90	(revision 764)
@@ -0,0 +1,124 @@
+   !!======================================================================
+   !!                         ***  trcini.lobster1.h90  ***
+   !! TOP :   Initialisation of LOBSTER 1 biological model
+   !!======================================================================
+   !! History :    -   !  1999-09  (M. Levy) Original code
+   !!              -   !  2000-12  (0. Aumont, E. Kestenare) add sediment 
+   !!             1.0  !  2004-03  (C. Ethe) Modularity
+   !!              -   !  2005-03  (O. Aumont, A. El Moussaoui) F90
+   !!----------------------------------------------------------------------
+
+#  include "domzgr_substitute.h90"
+#  include "passivetrc_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_ini
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE trc_ini  ***
+      !! ** purpose :   specific initialisation for lobster1 model
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk, jn
+      REAL(wp) ::   zdm0(jpi,jpj,jpk), zrro(jpi,jpj), zfluo, zfluu
+      REAL(wp) ::   ztest, zfluo, zfluu
+      REAL(wp), DIMENSION(jpi,jpj) ::   zrro
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdm0
+      !!----------------------------------------------------------------------
+
+      ! initialization of fields for optical model
+      ! --------------------------------------------
+      xze (:,:)   = 5.e0
+      xpar(:,:,:) = 0.e0
+
+      ! initialization for passive tracer remineralisation-damping  array
+      ! -----------------------------------------------------------------
+
+      DO jn = 1, jptra
+         remdmp(:,jn) = tminr
+      END DO
+
+      IF(lwp) THEN
+         WRITE(numout,*) ' '
+         WRITE(numout,*) ' trcini: compute remineralisation-damping  '
+         WRITE(numout,*) '         arrays for tracers'
+      ENDIF
+
+      ! initialization of biological variables
+      ! ------------------------------------------
+
+      ! Calculate vertical distribution of newly formed biogenic poc
+      ! in the water column in the case of max. possible bottom depth
+      ! ------------------------------------------------------------
+
+      zdm0   = 0.e0
+      zrro = 1.e0
+      DO jk = jpkb,jpkm1
+         DO jj =1, jpj
+            DO ji =1, jpi
+               zfluo = ( fsdepw(ji,jj,jk  ) / fsdepw(ji,jj,jpkb) )**xhr 
+               zfluu = ( fsdepw(ji,jj,jk+1) / fsdepw(ji,jj,jpkb) )**xhr
+               IF( zfluo.GT.1. )   zfluo = 1.e0
+               zdm0(ji,jj,jk) = zfluo - zfluu
+               IF( jk <= jpkb-1 )   zdm0(ji,jj,jk) = 0.e0
+               zrro(ji,jj) = zrro(ji,jj) - zdm0(ji,jj,jk)
+            END DO
+         END DO
+      END DO
+
+      zdm0(:,:,jpk) = zrro(:,:)
+
+      ! Calculate vertical distribution of newly formed biogenic poc
+      ! in the water column with realistic topography (first "dry" layer
+      ! contains total fraction, which has passed to the upper layers)
+      ! ----------------------------------------------------------------------
+      dminl = 0.
+      dmin3 = zdm0
+      DO jk = 1, jpk
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               IF( tmask(ji,jj,jk) == 0. ) THEN
+                  dminl(ji,jj) = dminl(ji,jj) + dmin3(ji,jj,jk)
+                  dmin3(ji,jj,jk) = 0.e0
+               ENDIF
+            END DO
+         END DO
+      END DO
+
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            IF( tmask(ji,jj,1) == 0 )   dmin3(ji,jj,1) = 0.e0
+         END DO
+      END DO
+
+      ! Coastal mask 
+      ! ------------   
+      cmask = 0.e0
+      DO ji = 2, jpi-1
+         DO jj = 2, jpj-1
+            if (tmask(ji,jj,1) == 1) then
+               ztest=tmask(ji+1,jj,1)*tmask(ji-1,jj,1)*tmask(ji,jj+1,1)*tmask(ji,jj-1,1)
+               IF (ztest == 0) cmask(ji,jj) = 1.
+            endif
+         END DO
+      END DO
+
+      cmask( 1 ,:) = cmask(jpi-1,:)
+      cmask(jpi,:) = cmask( 2   ,:)
+
+      !!gm BUG !!!!!   not valid in mpp and also not valid for north fold   !!!!!
+
+      ! Coastal surface
+      ! ---------------
+      areacot = 0.e0
+      DO ji = 2, jpi-1
+         DO jj = 2, jpj-1
+            areacot = areacot + e1t(ji,jj) * e2t(ji,jj) * cmask(ji,jj)
+         END DO
+      END DO
+      !
+   END SUBROUTINE trc_ini
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trclsm.lobster1.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trclsm.lobster1.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trclsm.lobster1.h90	(revision 764)
@@ -0,0 +1,205 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  trclsm.lobster1.h90  ***  
+   !! TOP :   Definition some run parameter for LOBSTER biological model
+   !!----------------------------------------------------------------------
+   !! History :    -  !  1999-10 (M.A. Foujols, M. Levy) original code
+   !!              -  !  2000-12 (O. Aumont, E. Kestenare) add sediments
+   !!             1.0 !  2003-08 (C. Ethe)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id $ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_lsm
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_lsm  ***  
+      !!
+      !! ** Purpose :   read LOBSTER namelist
+      !!
+      !! ** input   :   file 'namelist.trc.sms' containing the following
+      !!             namelist: natbio, natopt, and natdbi ("key_trc_diabio")
+      !!----------------------------------------------------------------------
+      CHARACTER (len=32) :: clname
+      !!
+      NAMELIST/natbio/ apmin, azmin, anmin, admin,                       &
+         &   redf, reddom, slopet, toptp, psinut, akno3, aknh4, rcchl,   &
+         &   rgamma, toptgz, tmaxgz, rgz,                                &
+         &   rppz, taus, aks, filmax, rpnaz, rdnaz, eggzoo, tauzn,       &
+         &   tmmaxp, tmminp, tmmaxz, tmminz, anumin, afdmin, taudn,      &
+         &   vsed, tmumax, aki, tmaxr, tminr, taunn, taudomn, xhr,       &
+         &   sedlam, sedlostpoc,                                         &
+         &   fphylab, fzoolab, fdetlab, fdbod
+      NAMELIST/natopt/ xkg0, xkr0, xkgp, xkrp, xlg, xlr, rpig
+#if defined key_trc_diabio
+      INTEGER :: ji
+      NAMELIST/natdbi/ctrbio,ctrbil,ctrbiu,nwritebio
+#endif
+      !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_lsm : read LOBSTER 1 namelists'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
+
+      !                               ! Open the namelist file
+      !                               ! ----------------------
+      clname ='namelist.trc.sms'
+      CALL ctlopn( numnat, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
+         &           1, numout, .FALSE., 1 )
+
+      !                               ! natbio : biological parameters
+      !                               ! ------------------------------
+      apmin = 0.                           ! default values
+      azmin = 0.
+      anmin = 0.
+      admin = 0.
+      redf  = 0.
+      reddom = 0.
+      slopet = 0.
+      toptp = 0.
+      psinut = 0.
+      akno3  = 0.
+      aknh4 = 0.
+      rcchl = 0.
+      rgamma= 0.
+      toptgz= 0.
+      tmaxgz= 0.
+      rgz   = 0.
+      rppz  = 0.
+      taus  = 0.
+      aks   = 0.
+      filmax= 0.
+      rpnaz = 0.
+      rdnaz = 0.
+      eggzoo= 0.
+      tauzn = 0.
+      tmmaxp= 0.
+      tmminp= 0.
+      tmmaxz= 0.
+      tmminz= 0.
+      anumin= 0.
+      afdmin= 0.
+      taudn = 0.
+      vsed  = 0.
+      tmumax= 0.
+      aki   = 0.
+      tmaxr   = 1./(     4.*rday)*0.
+      tminr   = 1./(24.*30.*rday)*0.
+      xhr=0.
+      sedlam=0.
+      sedlostpoc=0.
+      taudomn = 0.
+      taunn = 0.
+      fphylab = 0.
+      fzoolab = 0.
+      fdetlab = 0.
+      fdbod = 0.
+
+      REWIND( numnat )                     ! read natbio
+      READ  ( numnat, natbio )
+
+      IF(lwp) THEN
+          WRITE(numout,*) ' Namelist natbio'
+          WRITE(numout,*) '    minimum phytoplancton concentration                  apmin     =', apmin
+          WRITE(numout,*) '    minimum zooplancton   concentration                  azmin     =', azmin
+          WRITE(numout,*) '    minimum nutrients     concentration                  anmin     =', anmin
+          WRITE(numout,*) '    minimum detritus      concentration                  admin     =', admin
+          WRITE(numout,*) '    redfield ratio  c:n                                  redf      =', redf
+          WRITE(numout,*) '    van t hoff coefficient                               slopet    =', slopet
+          WRITE(numout,*) '    optimal photosynthesis temperature                   toptp     =', toptp
+          WRITE(numout,*) '    inhibition of no3 uptake by nh4                      psinut    =', psinut
+          WRITE(numout,*) '    half-saturation nutrient for no3 uptake              akno3     =', akno3
+          WRITE(numout,*) '    half-saturation nutrient for nh4 uptake              aknh4     =', aknh4
+          WRITE(numout,*) '    carbone/chlorophyl ratio                             rcchl     =', rcchl
+          WRITE(numout,*) '    phytoplankton exudation fraction                     rgamma    =', rgamma
+          WRITE(numout,*) '    optimal temperature for zoo growth                   toptgz    =', toptgz
+          WRITE(numout,*) '    maximal temperature for zoo growth                   tmaxgz    =', tmaxgz
+          WRITE(numout,*) '    widtht of zoo temperature FUNCTION                   rgz       =', rgz
+          WRITE(numout,*) '    zoo preference for phyto                             rppz      =', rppz
+          WRITE(numout,*) '    maximal zoo grazing rate                             taus      =', 86400 * taus, ' d'
+          WRITE(numout,*) '    half saturation constant for zoo food                aks       =', aks
+          WRITE(numout,*) '    maximal mass clearance rate for zoo                  filmax    =', filmax
+          WRITE(numout,*) '    non-assimilated phyto by zoo                         rpnaz     =', rpnaz
+          WRITE(numout,*) '    non-assimilated detritus by zoo                      rdnaz     =', rdnaz
+          WRITE(numout,*) '    minimum  for zoo concentration                       eggzoo    =', eggzoo
+          WRITE(numout,*) '    zoo specific excretion rate                          tauzn     =', 86400 * tauzn
+          WRITE(numout,*) '    maximal phyto mortality rate                         tmmaxp    =', 86400 * tmmaxp
+          WRITE(numout,*) '    minimal phyto mortality rate                         tmminp    =', 86400 * tmminp
+          WRITE(numout,*) '    maximal zoo mortality rate                           tmmaxz    =', 86400 * tmmaxz
+          WRITE(numout,*) '    minimal zoo mortality rate                           tmminz    =', 86400 * tmminz
+          WRITE(numout,*) '    nutrient threshold for phyto mort                    anumin    =', anumin
+          WRITE(numout,*) '    food threshold for zoo mort                          afdmin    =', afdmin
+          WRITE(numout,*) '    detrital breakdown rate                              taudn     =', 86400 * taudn , ' d'
+          WRITE(numout,*) '    detritus sedimentation speed                         vsed      =', 86400 * vsed  , ' d'
+          WRITE(numout,*) '    phyto max growth rate                                tmumax    =', 86400 * tmumax, ' d'
+          WRITE(numout,*) '    light hlaf saturation constant                       aki       =', aki
+          WRITE(numout,*) '    maximum damping for d z or p                         tmaxr     =', tmaxr
+          WRITE(numout,*) '    damping-remineralisation rate                        tminr     =', tminr
+          WRITE(numout,*) '    nitrification rate                                   taunn     =', taunn
+          WRITE(numout,*) '    dom remineralisation rate                            taudomn   =', taudomn
+          WRITE(numout,*) '    coeff for martin''s remineralistion                  xhr       =', xhr
+          WRITE(numout,*) '    time coeff of POC in sediments                       sedlam    =', sedlam
+          WRITE(numout,*) '    Sediment geol loss for POC                           sedlostpoc=', sedlostpoc
+          WRITE(numout,*) '    NH4 fraction of phytoplankton exsudation             fphylab   =', fphylab
+          WRITE(numout,*) '    NH4 fraction of zooplankton excretion                fzoolab   =', fzoolab
+          WRITE(numout,*) '    NH4 fraction of detritus dissolution                 fdetlab   =', fdetlab
+          WRITE(numout,*) '    Zooplankton mortality fraction that goes to detritus fdbod     =', fdbod
+      ENDIF
+
+      !                               ! natopt : optical parameters
+      !                               ! ---------------------------
+      xkg0  = 0.                           ! default values
+      xkr0  = 0.
+      xkgp  = 0.
+      xkrp  = 0.
+      xlg   = 0.
+      xlr   = 0.
+      rpig  = 0.
+
+      REWIND( numnat )                     ! read natopt
+      READ  ( numnat, natopt )       
+
+      IF(lwp) THEN                         ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist natopt'
+         WRITE(numout,*) '    green   water absorption coeff                       xkg0  = ', xkg0
+         WRITE(numout,*) '    red water absorption coeff                           xkr0  = ', xkr0
+         WRITE(numout,*) '    pigment red absorption coeff                         xkrp  = ', xkrp
+         WRITE(numout,*) '    pigment green absorption coeff                       xkgp  = ', xkgp
+         WRITE(numout,*) '    green chl exposant                                   xlg   = ', xlg
+         WRITE(numout,*) '    red   chl exposant                                   xlr   = ', xlr
+         WRITE(numout,*) '    chla/chla+phea ratio                                 rpig  = ', rpig
+      ENDIF
+
+#if defined key_trc_diabio
+
+      !                               ! natdbi : bio diagnostics
+      !                               ! ------------------------
+      nwritebio = 10                     ! default values
+      DO ji = 1, jpdiabio
+         IF(     ji <  10 ) THEN   ;   WRITE (ctrbio(ji),'("BIO_",I1)') ji      ! short name
+         ELSEIF (ji < 100 ) THEN   ;   WRITE (ctrbio(ji),'("BIO_",I2)') ji   
+         ELSE                      ;   WRITE (ctrbio(ji),'("BIO_",I3)') ji
+         ENDIF
+         WRITE(ctrbil(ji),'("BIOLOGICAL TREND NUMBER ",I2)') ji                 ! long name
+         ctrbiu(ji) = 'mmoleN/m3/s '                                            ! units
+      END DO
+
+      REWIND( numnat )                     ! read natdbi
+      READ  ( numnat, natdbi )  
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist natdbi'
+         WRITE(numout,*) '    frequency of outputs for biological outputs  nwritebio = ', nwritebio
+         DO ji = 1, jpdiabio
+            WRITE(numout,*) '     name of biological trend No :',ji,' : ',ctrbio(ji), ctrbil(ji), ' in ', ctrbiu(ji)
+         END DO
+      END IF
+#endif
+      !
+   END SUBROUTINE trc_lsm
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcopt.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcopt.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcopt.F	(revision 764)
@@ -0,0 +1,215 @@
+CC $Header$
+CDIR$ LIST
+      SUBROUTINE trcopt(kt)
+CCC---------------------------------------------------------------------
+CCC
+CCC                       ROUTINE trcopt
+CCC                     *******************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC     computes the light propagation in the water column
+CCC     and the euphotic layer depth
+CCC
+CCC
+CC   METHOD :
+CC   -------
+CC
+CC      multitasked on vertical slab (jj-loop)
+CC      local par is computed in w layers using light propagation
+CC      mean par in t layers are computed by integration
+CC
+CC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              ktask           : task identificator
+CC              kt              : time step
+CC      COMMON
+CC            /comcoo/          : orthogonal curvilinear coordinates
+CC                                and scale factors
+CC                                depths
+CC            /comzdf/          : avt vertical eddy diffusivity
+CC            /comqsr/          : solar radiation
+CC            /comtsk/          : multitasking
+CC            /cotopt/          : optical parameters
+CC            /cotbio/          : biological parameters
+CC
+CC   OUTPUT :
+CC   ------
+CC      COMMON
+CC            /cotopt/          : optical parameters
+CC
+CC   WORKSPACE :
+CC   ---------
+CC      local     zparr         : red compound of par
+CC                zparg         : green compound of par
+CC                zpar0m        : irradiance just below the surface
+CC                zpar100       : irradiance at euphotic layer depth
+CC                zkr           : total absorption coefficient in red
+CC                zkg           : total absorption coefficient in green
+CC                zpig          : total pigment
+CC                imaske        : euphotic layer mask
+CC                itabe         : euphotic layer last k index
+CC
+CC      COMMON
+CC
+CC   EXTERNAL :                   no
+CC   --------
+CC
+CC   REFERENCES :                 no
+CC   ----------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC       original : 95-05 (M. Levy)
+CC                  99-09 (J-M Andre & M. Levy)
+CC       modifications : 99-11 (C. Menkes M.A. Foujols) itabe initial. 
+CC       modifications : 00-02 (M.A. Foujols) change x**y par exp(y*log(x))
+CC----------------------------------------------------------------------
+CDIR$ NOLIST
+
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CCC---------------------------------------------------------------------
+CCC  OPA8, LODYC (11/96)
+CCC---------------------------------------------------------------------
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER kt
+
+#if defined key_passivetrc && defined key_trc_lobster1
+C
+      INTEGER ji,jj,jk,jn,in
+
+      REAL zpig,zkr,zkg
+
+      REAL zparr(jpi,jpk),zparg(jpi,jpk)
+      REAL zpar0m(jpi),zpar100(jpi)
+      INTEGER itabe(jpi),imaske(jpi,jpk)
+CC----------------------------------------------------------------------
+CC statement functions
+CC ===================
+CDIR$ NOLIST
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CCC---------------------------------------------------------------------
+CCC  OPA8, LODYC (15/11/96)
+CCC---------------------------------------------------------------------
+C
+C
+C find Phytoplancton index - test CTRCNM
+C
+      in=0
+      DO jn = 1,jptra
+        IF ((ctrcnm(jn) .EQ. 'PHY') .OR.
+     $      (ctrcnm(jn) .EQ. 'PHYTO') ) THEN
+            
+            in = jn
+        END IF
+      END DO
+      IF (in.eq.0) THEN 
+          IF (lwp) THEN 
+              WRITE (numout,*)
+     $            ' Problem trcopt : PHY or PHYTO not found '
+              CALL FLUSH(numout)
+          ENDIF 
+      ENDIF 
+C
+C vertical slab
+C ===============
+C
+      DO 1000 jj = 1,jpj
+C
+C
+C 1. determination of surface irradiance
+C --------------------------------------
+C
+C
+        DO ji = 1,jpi
+          zpar0m(ji) = qsr(ji,jj)*0.43
+          zpar100(ji) = zpar0m(ji)*0.01
+          xpar(ji,jj,1) = zpar0m(ji)
+          zparr(ji,1) = 0.5* zpar0m(ji)
+          zparg(ji,1) = 0.5* zpar0m(ji)
+        END DO
+
+C
+C 2. determination of xpar
+C ------------------------
+C
+C determination of local par in w levels
+        DO jk = 2,jpk
+          DO ji = 1,jpi
+            zpig = max(tiny(0.),trn(ji,jj,jk - 1,in))*12*redf/rcchl/rpig
+            zkr = xkr0 + xkrp*exp(xlr*log(zpig))
+            zkg = xkg0 + xkgp*exp(xlg*log(zpig))
+            zparr(ji,jk) = zparr(ji,jk - 1)
+     $          *exp( -zkr*fse3t(ji,jj,jk - 1) )
+            zparg(ji,jk) = zparg(ji,jk - 1)
+     $          *exp( -zkg*fse3t(ji,jj,jk - 1) )
+          END DO
+        END DO
+
+C
+C mean par in t levels
+        DO jk = 1,jpkm1
+          DO ji = 1,jpi
+            zpig = max(tiny(0.),trn(ji,jj,jk  ,in))*12*redf/rcchl/rpig
+            zkr = xkr0 + xkrp*exp(xlr*log(zpig))
+            zkg = xkg0 + xkgp*exp(xlg*log(zpig))
+            zparr(ji,jk) = zparr(ji,jk) / zkr / fse3t(ji,jj,jk)
+     $          * ( 1 - exp( -zkr*fse3t(ji,jj,jk) ) )
+            zparg(ji,jk) = zparg(ji,jk) / zkg / fse3t(ji,jj,jk)
+     $          * ( 1 - exp( -zkg*fse3t(ji,jj,jk) ) )
+            xpar(ji,jj,jk) = max(zparr(ji,jk)
+     $          + zparg(ji,jk),1.e-15)
+          END DO
+        END DO
+C
+C
+C 4. determination of euphotic layer depth 
+C ----------------------------------------
+C
+C imaske equal 1 in the euphotic layer, and 0 without
+C
+        DO jk = 1,jpk
+          DO ji = 1,jpi
+            imaske(ji,jk) = 0
+            IF (xpar(ji,jj,jk) .GE. zpar100(ji)) imaske(ji,jk) = 1
+          END DO
+        END DO
+C
+        DO ji = 1,jpi
+          itabe(ji) = 0
+        END DO
+C
+        DO jk = 1,jpk
+          DO ji = 1,jpi
+            itabe(ji) = itabe(ji) + imaske(ji,jk)
+          END DO
+        END DO
+C
+        DO ji = 1,jpi
+          itabe(ji) = max(1,itabe(ji))
+          xze(ji,jj) = fsdepw(ji,jj,itabe(ji) + 1)
+        END DO 
+C
+C
+C END of slab
+C ===========
+C
+ 1000 CONTINUE
+C
+#else
+C
+C no passive tracers
+C
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcsed.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcsed.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/LOBSTER/trcsed.F	(revision 764)
@@ -0,0 +1,183 @@
+CC $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/trcsed.F,v 1.7 2007/10/12 09:36:28 opalod Exp $
+CDIR$ LIST
+      SUBROUTINE trcsed(kt)
+CCC---------------------------------------------------------------------
+CCC
+CCC                       ROUTINE trcsed
+CCC                     *******************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC     compute the now trend due to the vertical sedimentation of
+CCC     detritus and add it to the general trend of detritus equations.
+CCC
+CCC
+CC   METHOD :
+CC   -------
+CC      this ROUTINE compute not exactly the advection but the
+CC      transport term, i.e.  dz(wt) and dz(ws)., dz(wtr)
+CC      using an upstream scheme
+CC
+CC	the now vertical advection of tracers is given by:
+CC
+CC      	dz(trn wn) = 1/bt dk+1( e1t e2t vsed (trn) )
+CC
+CC	add this trend now to the general trend of tracer (ta,sa,tra):
+CC
+CC                     tra = tra + dz(trn wn)
+CC
+CC      IF 'key_trc_diabio' key is activated, the now vertical advection
+CC      trend of passive tracers is saved for futher diagnostics.
+CC
+CC	multitasked on vertical slab (jj-loop)
+CC
+CC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              ktask           : task identificator
+CC              kt              : time step
+CC      COMMON
+CC            /comcoo/          : orthogonal curvilinear coordinates
+CC                                and scale factors
+CC            /cottrp/          : passive tracer fields
+CC            /comtsk/          : multitasking
+CC
+CC   OUTPUT :
+CC   ------
+CC      COMMON
+CC            /cottrp/tra       : general tracer trend increased by the
+CC				  now vertical tracer advection trend
+CC            /cottbd/ trbio    : now vertical passive tracer advection
+CC                                trend
+CC                                (IF 'key_trc_diabio' key is activated)
+CC
+CC   WORKSPACE :
+CC   ---------
+CC	local
+CC		ze1e2w, ze3tr, ztra
+CC      COMMON
+CC
+CC   EXTERNAL :                   no
+CC   --------
+CC
+CC   REFERENCES :                 no
+CC   ----------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC       original : 95-06 (M. Levy)
+CC       additions: 00-12 (E. Kestenare): clean up 
+CC----------------------------------------------------------------------
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      USE lbclnk
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER kt
+
+#if defined key_passivetrc && defined key_trc_lobster1
+
+      INTEGER ji,jj,jk
+      REAL ze3tr,ztra
+      REAL zwork(jpi,jpk)
+#if defined key_trc_diaadd
+      REAL ze3t(jpi,jpj,jpk)
+#endif
+CC----------------------------------------------------------------------
+CC statement functions
+CC ===================
+CDIR$ NOLIST
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CCC---------------------------------------------------------------------
+CCC  OPA8, LODYC (15/11/96)
+CCC---------------------------------------------------------------------
+C
+#if defined key_trc_diaadd
+C convert fluxes in per day
+      ze3t(:,:,:) = 0.
+      DO jk=1,jpkbm1
+        DO jj = 2, jpjm1
+          DO ji = 2, jpim1
+            ze3t(ji,jj,jk)=fse3t(ji,jj,jk)*86400.
+          END DO
+        END DO
+      END DO 
+#endif
+
+C
+C vertical slab
+C =============
+C
+      DO 1000 jj = 1,jpj
+
+C
+C
+C 1. sedimentation of detritus  : upstream scheme
+C -----------------------------------------------
+C
+C
+C for detritus sedimentation only - jpdet
+C
+C 1.1 initialisation needed for bottom and surface value
+C
+              DO jk=1,jpk
+                DO  ji = 1,jpi
+                  zwork(ji,jk) = 0.
+                END DO 
+              END DO
+C
+C 1.2 tracer flux at w-point: we use -vsed (downward flux)
+C with simplification : no e1*e2
+C
+              DO  jk = 2,jpk
+                DO  ji = 1,jpi
+                  zwork(ji,jk) = -vsed * trn(ji,jj,jk - 1,jpdet)
+                END DO
+              END DO
+C
+C 1.3 tracer flux divergence at t-point added to the general trend
+C
+              DO  jk = 1,jpkm1
+                DO  ji = 1,jpi
+                  ze3tr = 1./fse3t(ji,jj,jk)
+                  ztra = -ze3tr * (zwork(ji,jk) - zwork(ji,jk + 1))
+                  tra(ji,jj,jk,jpdet) = tra(ji,jj,jk,jpdet) + ztra
+#            if defined key_trc_diabio
+                  trbio(ji,jj,jk,8) = ztra
+#            endif
+#if defined key_trc_diaadd
+            trc2d(ji,jj,8)=trc2d(ji,jj,8)+ztra*ze3t(ji,jj,jk)
+#endif
+                END DO
+              END DO
+C
+C END of slab
+C ===========
+
+ 1000 CONTINUE
+C
+#if defined key_trc_diabio
+C Lateral boundary conditions on trcbio
+      CALL lbc_lnk (trbio(:,:,1,8), 'T', 1. )
+#endif
+#if defined key_trc_diaadd
+C Lateral boundary conditions on trc2d
+      CALL lbc_lnk (trc2d(:,:,8), 'T', 1. )
+#endif
+C
+
+#else
+C
+C     no passive tracer
+C
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/par_sms_pisces.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/par_sms_pisces.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/par_sms_pisces.h90	(revision 764)
@@ -0,0 +1,58 @@
+   !!======================================================================
+   !!                        ***  par_sms_pisces.h90  ***
+   !! pisces model :   assign a parameter to name individual tracers
+   !!======================================================================
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   INTEGER, PARAMETER ::   jpdiabio = 1   !: number of biological trends
+
+   ! WARNING: BE CAREFUL ABOUT THE ORDER WHEN READING THE RESTART FILE
+
+   INTEGER, PARAMETER ::   jpdic =  1     !: dissolved inoganic carbon concentration 
+   INTEGER, PARAMETER ::   jptal =  2     !: total alkalinity 
+   INTEGER, PARAMETER ::   jpoxy =  3     !: oxygen carbon concentration 
+   INTEGER, PARAMETER ::   jpcal =  4     !: calcite  concentration 
+   INTEGER, PARAMETER ::   jppo4 =  5     !: phosphate concentration 
+   INTEGER, PARAMETER ::   jppoc =  6     !: small particulate organic phosphate concentration
+   INTEGER, PARAMETER ::   jpsil =  7     !: silicate concentration
+   INTEGER, PARAMETER ::   jpphy =  8     !: phytoplancton concentration 
+   INTEGER, PARAMETER ::   jpzoo =  9     !: zooplancton concentration
+   INTEGER, PARAMETER ::   jpdoc = 10     !: dissolved organic carbon concentration 
+   INTEGER, PARAMETER ::   jpdia = 11     !: Diatoms Concentration
+   INTEGER, PARAMETER ::   jpmes = 12     !: Mesozooplankton Concentration
+   INTEGER, PARAMETER ::   jpbsi = 13     !: (big) Silicate Concentration
+   INTEGER, PARAMETER ::   jpfer = 14     !: Iron Concentration
+#if ! defined key_trc_kriest
+   !!----------------------------------------------------------------------
+   !!   Default                                             Standard PISCES
+   !!----------------------------------------------------------------------
+   INTEGER, PARAMETER ::   jpbfe = 15     !: Big iron particles Concentration
+   INTEGER, PARAMETER ::   jpgoc = 16     !: big particulate organic phosphate concentration
+   INTEGER, PARAMETER ::   jpsfe = 17     !: Small iron particles Concentration
+   INTEGER, PARAMETER ::   jpdfe = 18     !: Diatoms iron Concentration
+   INTEGER, PARAMETER ::   jpdsi = 19     !: Diatoms Silicate Concentration
+   INTEGER, PARAMETER ::   jpnfe = 20     !: Nano iron Concentration
+   INTEGER, PARAMETER ::   jpnch = 21     !: Nano Chlorophyll Concentration
+   INTEGER, PARAMETER ::   jpdch = 22     !: Diatoms Chlorophyll Concentration
+   INTEGER, PARAMETER ::   jpno3 = 23     !: Nitrates Concentration
+   INTEGER, PARAMETER ::   jpnh4 = 24     !: Ammonium Concentration
+#else
+   !!----------------------------------------------------------------------
+   !!   'key_trc_kriest'                                    PISCES + kriest
+   !!----------------------------------------------------------------------
+   INTEGER, PARAMETER ::   jpnum = 15     !: Big iron particles Concentration
+   INTEGER, PARAMETER ::   jpsfe = 16     !: number of particulate organic phosphate concentration
+   INTEGER, PARAMETER ::   jpdfe = 17     !: Diatoms iron Concentration
+   INTEGER, PARAMETER ::   jpdsi = 18     !: Diatoms Silicate Concentration
+   INTEGER, PARAMETER ::   jpnfe = 19     !: Nano iron Concentration
+   INTEGER, PARAMETER ::   jpnch = 20     !: Nano Chlorophyll Concentration
+   INTEGER, PARAMETER ::   jpdch = 21     !: Diatoms Chlorophyll Concentration
+   INTEGER, PARAMETER ::   jpno3 = 22     !: Nitrates Concentration
+   INTEGER, PARAMETER ::   jpnh4 = 23     !: Ammonium Concentration
+#endif
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/sms_pisces.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/sms_pisces.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/sms_pisces.h90	(revision 764)
@@ -0,0 +1,152 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  sms_pisces.h90  ***  
+   !! TOP :   PISCES Source Minus Sink valiables
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2000-02 (O. Aumont) original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! Variable for chemistry of the CO2 cycle
+   !! ---------------------------------------------------------------------
+   REAL(wp) ::   atcco2, atcox
+   !
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   akb3, ak13, ak23, aksp, akw3             !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   akp13, akp23, akp33, aksi3, aks3, akf3   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   hi, borat                                !: ???
+
+   !!----------------------------------------------------------------------
+   !!  Variable for chemistry of the CO2 cycle
+   !! ---------------------------------------------------------------------
+   REAL(wp), DIMENSION(10) ::   devk1, devk2, devk3, devk4, devk5     
+   !
+   REAL(wp) ::   akcc1, akcc2, akcc3, akcc4,akcc5, akcc6, akcc7, akcc8, akcc9     !: ???
+   REAL(wp) ::   bor1, bor2, c00, c01, c02, c03, c04, c05, c10, c11               !: ???
+   REAL(wp) ::   c12, c13, c20, c21, c22, c23, cb0, cb1, cb2, cb3                 !: ???
+   REAL(wp) ::   cb4, cb5, cb6, cb7, cb8, cb9, cb10, cb11, c14                    !: ???
+   REAL(wp) ::   cw3, cw4, cw5, cw6, cw0, cw1, cw2, ox0, ox1, ox2, ox3, ox4,ox5   !: ???
+   REAL(wp) ::   salchl, rgas, oxyco, ca0, ca1, ca2, ca3, ca4, ca5, ca6           !: ???
+   REAL(wp) ::   cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp20, cp21             !: ???
+   REAL(wp) ::   cp22, cp23, cp24, cp25, cp26, cp30, cp31, cp32, cp33             !: ???
+   REAL(wp) ::   cp34, cp35, cs10, cs11, cs12, cs13, cs14, cs15, cs16             !: ???
+   REAL(wp) ::   cs17, cs18, cs19, cs20, cs21                                     !: ???
+   REAL(wp) ::   st1, st2, ft1, ft2, ks0, ks1, ks2, ks3, ks4, ks5                 !: ???
+   REAL(wp) ::   ks6, ks7, ks8, ks9, ks10, ks11, ks12, kf0, kf1                   !: ???
+   REAL(wp) ::   kf2, kf3, kf4
+   !
+   REAL(wp), DIMENSION(jpi,jpj,3) ::   chemc   !: ???
+
+   !!----------------------------------------------------------------------
+   !!  Variable for chemistry of Fe and SIO3
+   !! ---------------------------------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   sio3eq   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   fekeq    !: ???
+
+   !!----------------------------------------------------------------------
+   !!  Time variables
+   !! ---------------------------------------------------------------------
+   INTEGER  ::   iabsyr, nrdttrc, ndayflxtr       !: ???
+   REAL(wp) ::   tspyr, absyr, xtvit              !: ???
+   REAL(wp) ::   rfact, rfactr, rfact2, rfact2r   !: ???
+
+
+   !!----------------------------------------------------------------------
+   !!  Gas exchange
+   !! ---------------------------------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj) ::   strn         !: ???
+   
+   !!---------------------------------------
+   !!  Biological parameters 
+   !! --------------------------------------
+   INTEGER ::   jkopt    !: ???
+   !
+   REAL(wp) ::   caco3r, kdca, nca, part, rno3, o2ut, po4r               !: ???
+   REAL(wp) ::   sco2, dispo0, conc0,sumdepsi,rivalkinput,sedfeinput     !: ???
+   REAL(wp) ::   calcon, rivpo4input,nitdepinput,oxymin,spocri           !: ???
+   REAL(wp) ::   nitrif,rdenit,o2nit,concnnh4,concdnh4                   !: ???
+   REAL(wp) ::   pislope,excret,wsbio,resrat,mprat,wchl,wchld            !: ???
+   REAL(wp) ::   mzrat,grazrat,xprefc,xprefp,unass,xkgraz,xkmort         !: ???
+   REAL(wp) ::   xksi1,xksi2,sicmax,xremik,xremip,xkdoc1                 !: ???
+   REAL(wp) ::   xkdoc2,grosip,resrat2,excret2,mprat2,mzrat2,xprefz      !: ???
+   REAL(wp) ::   xkgraz2,grazrat2,xlam1,conc1,conc2,conc3                !: ???
+   REAL(wp) ::   unass2,xprefpoc,epsher,epsher2,pislope2,mpratm          !: ???
+   REAL(wp) ::   sigma1, sigma2, zprefc, zprefp, zprefd, wchl2, ferat3   !: ???
+   REAL(wp) ::   xsirem, fecnm, fecdm, chlcnm, chlcdm                    !: ???
+
+   !!---------------------------------------------
+   !!  Biological fluxes for light
+   !!---------------------------------------------
+   REAL(wp), DIMENSION(3,61)        ::   xkrgb                 !: ???
+   REAL(wp), DIMENSION(jpi,jpj)     ::   zmeu                  !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   etot, etot3, emoy     !: ???
+
+!!----------------------------------------------------------
+!!  Biological fluxes for primary production
+!!----------------------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj) ::   xksimax, xksi
+   !
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   prmax, tgfunc, tgfunc2                       !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   prcaca, prorca, prorca2, prorca3             !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   prorca4, prorca5, prorca6, prorca7           !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   pronew, pronew2, proreg, proreg2             !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xnanono3, xdiatno3, xnanonh4, xdiatnh4       !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xlimphy, xlimdia, concdfe, concnfe, znegtr   !: ???
+
+   !!------------------------------------------
+   !! Sinks for phytoplankton
+   !!------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   tortp, tortnf, tortnch            !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   respp, respp2, respnch, respdch   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   tortp2, tortdf, tortdch, tortds   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   respds, respdf, respnf            !: ???
+
+   !!------------------------------------
+   !!  SMS for zooplankton
+   !!-------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   respz, tortz, grazp, grazpf                   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grazpch, grazm, grazmf, grazsd                !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grazsf, grazss, grazsch, grarem               !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grafer,respz2,tortz2,grazd, grazz,grazn       !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grazpoc,graznf, graznch, grazs, grazf         !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grazdch, grazpof, grarem2, grafer2, grapoc2   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grapoc, grazffe, grazfff                      !: ???
+
+   !!---------------------------------------------
+   !!  SMS for the organic matter
+   !!---------------------------------------------
+   REAL(wp) ::   wsbio2
+   !
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xagg, xaggfe, zdiss, xaggdoc, xaggdfe, xbactfer   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xscave, olimi, orem, orem2, ofer, ofer2           !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   osil, xaggdoc2, nitrfac, xlimbac                  !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   wsbio4, wsbio3, wscal                             !: ???
+
+   !!---------------------------------------------------------
+   !! External sources of nutrients in ocean
+   !!---------------------------------------------------------
+   LOGICAL ::   bdustfer, briver, bndepo, bsedinput   !: ???
+   !
+   REAL(wp) ::   areacot                              !: ???
+   !
+   REAL(wp), DIMENSION(jpi,jpj)     ::   dust, cotdep, nitdep, rivinp   !: ???
+   REAL(wp), DIMENSION(jpi,jpj,12)  ::   dustmo                         !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   onitr, denitr, ironsed         !: ???
+
+#if defined key_trc_kriest
+   !!---------------------------------------------------------
+   !!  Kriest parameter for aggregation
+   !!---------------------------------------------------------
+   REAL(wp) ::   xkr_eta, xkr_zeta, xkr_sfact, xkr_stick            !: ???
+   REAL(wp) ::   xkr_mass_min, xkr_mass_max, xkr_massp, xkr_frac    !: ???
+   REAL(wp) ::   xkr_dnano, xkr_ddiat, xkr_dmeso, xkr_daggr         !: ???
+   REAL(wp) ::   xkr_nnano, xkr_ndiat, xkr_nmeso, xkr_naggr         !: ???
+   REAL(wp) ::   xkr_wsbio_min, xkr_wsbio_max
+   !  
+   REAL(wp), DIMENSION(jpk) ::   xnumm      !: ???
+#endif
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcctl.pisces.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcctl.pisces.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcctl.pisces.h90	(revision 764)
@@ -0,0 +1,33 @@
+   !!======================================================================
+   !!                         ***  trcctl.cfc.h90  ***
+   !! TOP :   Control of CFC chemical model
+   !!======================================================================
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2005-10 (C. Ethe) assign a parameter to name individual tracers
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' use PISCES biological model '
+
+   ! Check number of tracers
+   ! -----------------------
+#if  defined key_trc_kriest
+      IF( jptra /= 23) THEN 
+#else
+      IF( jptra /= 24) THEN
+#endif
+          IF (lwp) THEN 
+              WRITE (numout,*) ' ===>>>> : w a r n i n g '
+              WRITE (numout,*) ' =======   ============= '
+              WRITE (numout,*)                               &
+              &   ' STOP, change jptra',               & 
+              &   ' in parameter.passivetrc.pisces.h '  
+          END IF 
+          STOP 'TRC_CTL'
+      END IF 
+      
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcini.pisces.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcini.pisces.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trcini.pisces.h90	(revision 764)
@@ -0,0 +1,544 @@
+   !!======================================================================
+   !!                         ***  trcini.pisces.h90  ***
+   !! TOP :   Initialisation of PISCES biological model
+   !!======================================================================
+   !! History :    -   !  1988-07  (E. Maier-Reiner) Original code
+   !!              -   !  1999-10  (O. Aumont, C. Le Quere)
+   !!              -   !  2002     (O. Aumont)  PISCES
+   !!             1.0  !  2005-03  (O. Aumont, A. El Moussaoui) F90
+   !!----------------------------------------------------------------------
+
+#  include "domzgr_substitute.h90"
+#  include "passivetrc_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_ini
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE trc_ini ***
+      !!
+      !! ** Purpose :   Initialisation of PISCES biological and chemical variables
+      !!----------------------------------------------------------------------
+      USE iom
+      !!
+      INTEGER :: ji,jj,jk
+      INTEGER :: ichl,iband,jm
+      INTEGER , PARAMETER :: jpmois = 12, jpan   = 1 
+
+      REAL(wp) :: zcoef
+      REAL(wp) :: ztoto,expide,denitide,ztra,zmaskt
+      REAL(wp) , DIMENSION (jpi,jpj) :: riverdoc,river,ndepo
+      REAL(wp) , DIMENSION (jpi,jpj,jpk) :: cmask
+
+      INTEGER :: numriv, numdust, numbath, numdep
+      INTEGER :: numlight 
+
+#if defined key_trc_kriest
+      INTEGER  ::   jn, kiter
+      REAL(wp) ::   znum, zdiv
+      REAL(wp) ::   zws,zwr, zwl,wmax, xnummax, &
+      REAL(wp) ::   zmin, zmax, zl, zr, xacc
+#endif
+      !!----------------------------------------------------------------------
+
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_ini :   PISCES biological and chemical initialisation'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
+
+
+      !                                            ! Time-step
+      rfact   = rdttra(1) * float(ndttrc)          ! ---------
+      rfactr  = 1. / rfact
+      rfact2  = rfact / float(nrdttrc)
+      rfact2r = 1. / rfact2
+
+      IF(lwp) WRITE(numout,*) '    Tracer  time step=', rfact, ' rdt = ', rdt
+      IF(lwp) write(numout,*) '    Biology time step=', rfact2
+
+
+      !                                            ! Dust input from the atmosphere
+      IF( bdustfer ) THEN                          ! ------------------------------
+         IF(lwp) WRITE(numout,*) '    Initialize dust input from atmosphere '
+         CALL iom_open ( 'dust.orca.nc', numdust )
+         DO jm = 1, jpmois
+            CALL iom_get( numdust, jpdom_data, 'dust', dustmo(:,:,jm), jm )
+         END DO
+         CALL iom_close( numdust )
+      ELSE
+         dustmo(:,:,:) = 0.e0
+      ENDIF
+
+
+      !                                            ! Nutrient input from rivers
+      IF( briver ) THEN                            ! --------------------------
+         IF(lwp) WRITE(numout,*) '    Initialize the nutrient input by rivers from river.orca.nc file'
+         CALL iom_open ( 'river.orca.nc', numriv )
+         CALL iom_get  ( numriv, jpdom_data, 'riverdic', river   (:,:), jpan )
+         CALL iom_get  ( numriv, jpdom_data, 'riverdoc', riverdoc(:,:), jpan )
+         CALL iom_close( numriv )
+      ELSE
+         river   (:,:) = 0.e0
+         riverdoc(:,:) = 0.e0
+      endif
+
+      !                                            ! Nutrient input from dust
+      IF( bndepo ) THEN                            ! ------------------------
+         IF(lwp) WRITE(numout,*) '    Initialize the nutrient input by dust from ndeposition.orca.nc'
+         CALL iom_open ( 'ndeposition.orca.nc', numdep )
+         CALL iom_get  ( numdep, jpdom_data, 'ndep', ndepo(:,:), jpan )
+         CALL iom_close( numdep )
+      ELSE
+         ndepo(:,:) = 0.e0
+      ENDIF
+
+      !                                            ! Coastal and island masks
+      IF( bsedinput ) THEN                         ! ------------------------
+         IF(lwp) WRITE(numout,*) '    Computation of an island mask to enhance coastal supply of iron '
+         IF(lwp) WRITE(numout,*) '       from bathy.orca.nc file '
+         CALL iom_open ( 'bathy.orca.nc', numbath )
+         CALL iom_get  ( numbath, jpdom_data, 'bathy', cmask(:,:,:), jpan )
+         CALL iom_close( numbath )
+         !
+         DO jk = 1, 5
+            DO jj = 2, jpjm1
+               DO ji = 2, jpim1
+                  IF( tmask(ji,jj,jk) /= 0. ) THEN
+                     zmaskt = tmask(ji+1,jj,jk) * tmask(ji-1,jj,jk) * tmask(ji,jj+1,jk)    &
+                        &                       * tmask(ji,jj-1,jk) * tmask(ji,jj,jk+1)
+                     IF( zmaskt == 0. )   cmask(ji,jj,jk ) = 0.1
+                  ENDIF
+               END DO
+            END DO
+         END DO
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  expide   = MIN( 8.,( fsdept(ji,jj,jk) / 500. )**(-1.5) )
+                  denitide = -0.9543 + 0.7662 * LOG( expide ) - 0.235 * LOG( expide )**2
+                  cmask(ji,jj,jk) = cmask(ji,jj,jk) * MIN( 1., EXP( denitide ) / 0.5 )
+               END DO
+            END DO
+         END DO    
+      ELSE
+         cmask(:,:,:) = 0.e0
+      ENDIF
+
+      CALL lbc_lnk( cmask , 'T', 1. )      ! Lateral boundary conditions on cmask   (sign unchanged)
+
+
+      !                                            ! total atmospheric supply of Si
+      !                                            ! ------------------------------
+      sumdepsi = 0.e0
+      DO jm = 1, jpmois
+         DO jj = 2, jpjm1
+            DO ji = 2, jpim1
+               sumdepsi = sumdepsi + dustmo(ji,jj,jm) / (12.*rmoss) * 8.8        &
+                  &     * 0.075/28.1 * e1t(ji,jj) * e2t(ji,jj) * tmask(ji,jj,1) * tmask_i(ji,jj)
+            END DO
+         END DO
+      END DO
+      IF( lk_mpp )   CALL mpp_sum( sumdepsi )  ! sum over the global domain
+
+      !                                            ! N/P and Si releases due to coastal rivers
+      !                                            ! -----------------------------------------
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zcoef = raass * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,1)
+            cotdep(ji,jj) =  river(ji,jj)                  *1E9 / ( 12. * zcoef + rtrn ) * tmask(ji,jj,1)
+            rivinp(ji,jj) = (river(ji,jj)+riverdoc(ji,jj)) *1E9 / ( 31.6* zcoef + rtrn ) * tmask(ji,jj,1)
+            nitdep(ji,jj) = 7.6 * ndepo(ji,jj)                  / ( 14E6*raass*fse3t(ji,jj,1) + rtrn ) * tmask(ji,jj,1)
+         END DO
+      END DO
+      ! Lateral boundary conditions on ( cotdep, rivinp, nitdep )   (sign unchanged)
+      CALL lbc_lnk( cotdep , 'T', 1. )  ;  CALL lbc_lnk( rivinp , 'T', 1. )  ;  CALL lbc_lnk( nitdep , 'T', 1. )
+
+      rivpo4input=0.e0
+      rivalkinput=0.e0
+      nitdepinput=0.e0
+      DO jj = 2 , jpjm1
+         DO ji = 2, jpim1
+            zcoef = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,1)) * tmask(ji,jj,1) * tmask_i(ji,jj) * raass
+            rivpo4input = rivpo4input + rivinp(ji,jj) * zcoef
+            rivalkinput = rivalkinput + cotdep(ji,jj) * zcoef
+            nitdepinput = nitdepinput + nitdep(ji,jj) * zcoef
+         END DO
+      END DO
+      IF( lk_mpp ) THEN
+         CALL mpp_sum( rivpo4input )  ! sum over the global domain
+         CALL mpp_sum( rivalkinput )  ! sum over the global domain
+         CALL mpp_sum( nitdepinput )  ! sum over the global domain
+      ENDIF
+
+
+      !                                            !    Coastal supply of iron
+      !                                            ! -------------------------
+      DO jk = 1, jpkm1
+         ironsed(:,:,jk) = sedfeinput * cmask(:,:,jk) / ( fse3t(:,:,jk) * rjjss )
+      END DO
+      CALL lbc_lnk( ironsed , 'T', 1. )      ! Lateral boundary conditions on ( ironsed )   (sign unchanged)
+
+
+
+#if defined key_trc_kriest
+      !----------------------------------------------------------------------
+      !  COMPUTATION OF THE VERTICAL PROFILE OF MAXIMUM SINKING SPEED
+      !  Search of the maximum number of particles in aggregates for each k-level.  
+      !  Bissection Method
+      !--------------------------------------------------------------------
+      WRITE(numout,*)
+      WRITE(numout,*)'    kriest : Compute maximum number of particles in aggregates'
+            
+      xacc     =  0.001
+      kiter    = 50
+      zmin     =  1.10
+      zmax     = xkr_mass_max / xkr_mass_min
+      xkr_frac = zmax
+
+      DO jk =1,jpk
+         zl = zmin
+         zr = zmax
+         wmax = 0.5 * fse3t(1,1,jk) * rjjss / rfact2
+         zdiv = xkr_zeta + xkr_eta - xkr_eta * zl
+         znum = zl - 1.
+         zwl =  xkr_wsbio_min * xkr_zeta / zdiv &
+            & - ( xkr_wsbio_max * xkr_eta * znum * &
+            &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+            & - wmax
+  
+         zdiv = xkr_zeta + xkr_eta - xkr_eta * zr
+         znum = zr - 1.
+         zwr =  xkr_wsbio_min * xkr_zeta / zdiv &
+            & - ( xkr_wsbio_max * xkr_eta * znum * &
+            &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+            & - wmax
+
+iflag:  DO jn = 1, kiter               
+           IF( zwl == 0.e0 ) THEN
+              xnummax = zl
+           ELSE IF ( zwr == 0.e0 ) THEN
+              xnummax = zr
+           ELSE
+              xnummax = ( zr + zl ) / 2.
+              zdiv = xkr_zeta + xkr_eta - xkr_eta * xnummax
+              znum = xnummax - 1.
+              zws =  xkr_wsbio_min * xkr_zeta / zdiv &
+                 & - ( xkr_wsbio_max * xkr_eta * znum * &
+                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                 & - wmax
+              IF( zws * zwl < 0. ) THEN
+                 zr = xnummax
+              ELSE
+                 zl = xnummax
+              ENDIF
+              zdiv = xkr_zeta + xkr_eta - xkr_eta * zl
+              znum = zl - 1.
+              zwl =  xkr_wsbio_min * xkr_zeta / zdiv &
+                 & - ( xkr_wsbio_max * xkr_eta * znum * &
+                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                 & - wmax
+              
+              zdiv = xkr_zeta + xkr_eta - xkr_eta * zr
+              znum = zr - 1.
+              zwr =  xkr_wsbio_min * xkr_zeta / zdiv &
+                 & - ( xkr_wsbio_max * xkr_eta * znum * &
+                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                 & - wmax
+
+              IF ( ABS ( zws )  <= xacc ) EXIT iflag
+
+           ENDIF
+                    
+        END DO iflag
+               
+        xnumm(jk) = xnummax
+        WRITE(numout,*) '       jk = ', jk, ' wmax = ', wmax,' xnum max = ', xnumm(jk)
+        
+     END DO
+
+#endif
+
+      !----------------------------------------------------------------------
+      ! Initialize biological variables 
+      !----------------------------------------------------------------------
+      ! Set biological ratios
+      ! ---------------------
+      rno3   = (16.+2.) / 122.
+      po4r   =   1.e0   / 122.
+      o2nit  =  32.     / 122.
+      rdenit =  97.6    /  16.
+      o2ut   = 140.     / 122.
+
+      !----------------------------------------------------------------------
+      ! Initialize chemical variables 
+      !----------------------------------------------------------------------
+
+      ! set pre-industrial atmospheric [co2] (ppm) and o2/n2 ratio
+      ! ----------------------------------------------------------
+      atcox = 0.20946
+
+      ! Set lower/upper limits for temperature and salinity
+      ! ---------------------------------------------------
+      salchl = 1.e0 / 1.80655
+      calcon = 1.03e-2
+
+      ! Set coefficients for apparent solubility equilibrium of calcite
+      ! Millero et al. 1995 from Mucci 1983
+      ! --------------------------------------------------------------
+      akcc1 = -171.9065
+      akcc2 =   -0.077993
+      akcc3 = 2839.319
+      akcc4 =   71.595
+      akcc5 =   -0.77712
+      akcc6 =    0.0028426
+      akcc7 =  178.34
+      akcc8 =   -0.07711
+      akcc9 =    0.0041249
+
+      ! Set coefficients for seawater pressure correction
+      ! -------------------------------------------------
+      devk1(1) = -25.5
+      devk2(1) =   0.1271
+      devk3(1) =   0.e0
+      devk4(1) =  -3.08E-3
+      devk5(1) =   0.0877E-3
+      !
+      devk1(2) = -15.82
+      devk2(2) =  -0.0219
+      devk3(2) =   0.e0
+      devk4(2) =   1.13E-3
+      devk5(2) =  -0.1475E-3
+      !
+      devk1(3) = -29.48
+      devk2(3) =   0.1622
+      devk3(3) =   2.608E-3
+      devk4(3) =  -2.84E-3
+      devk5(3) =   0.e0
+      !
+      devk1(4) = -14.51
+      devk2(4) =   0.1211
+      devk3(4) =  -0.321E-3
+      devk4(4) =  -2.67E-3
+      devk5(4) =   0.0427E-3
+      !
+      devk1(5) = -23.12
+      devk2(5) =   0.1758
+      devk3(5) =  -2.647E-3
+      devk4(5) =  -5.15E-3
+      devk5(5) =   0.09E-3
+      !
+      devk1(6) = -26.57
+      devk2(6) =   0.2020
+      devk3(6) =  -3.042E-3
+      devk4(6) =  -4.08E-3
+      devk5(6) =   0.0714E-3
+      !
+      devk1(7) = -25.60
+      devk2(7) =   0.2324
+      devk3(7) =  -3.6246E-3
+      devk4(7) =  -5.13E-3
+      devk5(7) =   0.0794E-3
+      !
+      ! For calcite with Edmond and Gieske 1970
+      !     devkst = 0.23
+      !     devks  = 35.4
+      ! Millero 95 takes this depth dependance for calcite
+      devk1(8) = -48.76
+      devk2(8) =   0.5304
+      devk3(8) =   0.e0
+      devk4(8) = -11.76E-3
+      devk5(8) =   0.3692E-3
+      !
+      ! Coefficients for sulfate and fluoride
+      devk1(9) = -18.03
+      devk2(9) =   0.0466
+      devk3(9) =   0.316e-3
+      devk4(9) =  -4.53e-3
+      devk5(9) =   0.09e-3
+
+      devk1(10) = -9.78
+      devk2(10) = -0.0090
+      devk3(10) = -0.942e-3
+      devk4(10) = -3.91e-3
+      devk5(10) =  0.054e-3
+
+
+      ! Set universal gas constants
+      ! ---------------------------
+      rgas  = 83.143
+      oxyco =  1.e0 / 22.4144
+
+      ! Set boron constants
+      ! -------------------
+      bor1 = 0.00023
+      bor2 = 1.e0 / 10.82
+
+      ! Set volumetric solubility constants for co2 in ml/l (Weiss, 1974)
+      ! -----------------------------------------------------------------
+      c00 = -60.2409
+      c01 =  93.4517
+      c02 =  23.3585
+      c03 =   0.023517
+      c04 =  -0.023656
+      c05 =   0.0047036
+      !
+      ca0 = -162.8301
+      ca1 =  218.2968
+      ca2 =   90.9241
+      ca3 =   -1.47696
+      ca4 =    0.025695
+      ca5 =   -0.025225
+      ca6 =    0.0049867
+
+      ! Set coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970)
+      ! ---------------------------------------------------------------------
+      c10 = -3670.7
+      c11 =    62.008
+      c12 =    -9.7944
+      c13 =     0.0118
+      c14 =    -0.000116
+
+      ! Set coeff. for 2. dissoc. of carbonic acid (Edmond and Gieskes, 1970)
+      ! ---------------------------------------------------------------------
+      c20 = -1394.7
+      c21 =    -4.777
+      c22 =     0.0184
+      c23 =    -0.000118
+
+      ! Set constants for calculate concentrations for sulfate and fluoride
+      ! sulfates (Morris & Riley 1966)
+      !----------------------------------------------------------------------
+      st1 = 0.14
+      st2 = 1.e0 / 96.062
+
+      ! fluoride
+      ! --------
+      ft1 = 0.000067
+      ft2 = 1.e0 / 18.9984
+
+      ! sulfates (Dickson 1990 change to mol:kg soln, idem OCMIP)
+      !----------------------------------------------------------
+      ks0  =    141.328
+      ks1  =  -4276.1
+      ks2  =    -23.093
+      ks3  = -13856.
+      ks4  =    324.57
+      ks5  =    -47.986
+      ks6  =  35474.
+      ks7  =   -771.54
+      ks8  =    114.723
+      ks9  =  -2698.
+      ks10 =   1776.
+      ks11 =      1.
+      ks12 =     -0.001005
+
+      ! fluorides (Dickson & Riley 1979 change to mol/kg soln)
+      !-------------------------------------------------------
+      kf0 =  -12.641
+      kf1 = 1590.2
+      kf2 =    1.525
+      kf3 =    1.0
+      kf4 =   -0.001005
+
+      ! Set coeff. for 1. dissoc. of boric acid (Edmond and Gieskes, 1970)
+      ! ------------------------------------------------------------------
+      cb0  = -8966.90
+      cb1  = -2890.53
+      cb2  =   -77.942
+      cb3  =     1.728
+      cb4  =    -0.0996
+      cb5  =   148.0248
+      cb6  =   137.1942
+      cb7  =     1.62142
+      cb8  =   -24.4344
+      cb9  =   -25.085
+      cb10 =    -0.2474
+      cb11 =     0.053105
+
+      ! Set coeff. for dissoc. of water (Dickson and Riley, 1979, 
+      !   eq. 7, coefficient cw2 corrected from 0.9415 to 0.09415 
+      !   after pers. commun. to B. Bacastow, 1988)
+      ! ---------------------------------------------------------
+      cw0 = -13847.26
+      cw1 =    148.9652
+      cw2 =    -23.6521
+      cw3 =    118.67
+      cw4 =     -5.977
+      cw5 =      1.0495
+      cw6 =     -0.01615
+
+      ! Set coeff. for dissoc. of phosphate (Millero (1974)
+      ! ---------------------------------------------------
+      cp10 =   115.54
+      cp11 = -4576.752
+      cp12 =   -18.453
+      cp13 =  -106.736
+      cp14 =     0.69171
+      cp15 =    -0.65643
+      cp16 =    -0.01844
+      !
+      cp20 =   172.1033
+      cp21 = -8814.715
+      cp22 =   -27.927
+      cp23 =  -160.340
+      cp24 =     1.3566
+      cp25 =     0.37335
+      cp26 =    -0.05778
+      !
+      cp30 =   -18.126
+      cp31 = -3070.75
+      cp32 =    17.27039
+      cp33 =     2.81197
+      cp34 =   -44.99486
+      cp35 =    -0.09984
+
+      ! Set coeff. for dissoc. of phosphate (Millero (1974)
+      ! ---------------------------------------------------
+      cs10 =   117.385
+      cs11 = -8904.2
+      cs12 =   -19.334
+      cs13 =  -458.79
+      cs14 =     3.5913
+      cs15 =   188.74
+      cs16 =    -1.5998
+      cs17 =   -12.1652
+      cs18 =     0.07871
+      cs19 =     0.e0
+      cs20 =     1.e0
+      cs21 =    -0.001005
+
+
+      ! Set volumetric solubility constants for o2 in ml/l (Weiss, 1970)
+      ! ----------------------------------------------------------------
+      ox0 = -58.3877
+      ox1 =  85.8079
+      ox2 =  23.8439
+      ox3 =  -0.034892
+      ox4 =   0.015568
+      ox5 =  -0.0019387
+
+      !  FROM THE NEW BIOOPTIC MODEL PROPOSED JM ANDRE, WE READ HERE
+      !  A PRECOMPUTED ARRAY CORRESPONDING TO THE ATTENUATION COEFFICIENT
+
+      CALL ctlopn( numlight, 'kRGB61.txt', 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
+         &           1, numout, .TRUE., 1 )
+      DO ichl = 1,61
+         READ(numlight,*) ztoto, ( xkrgb(iband,ichl), iband = 1,3 )
+      END DO
+      CLOSE(numlight)
+
+
+      CALL p4zche        ! initialize the chemical constants
+
+
+      ndayflxtr = 0      !  Initialize a counter for the computation of chemistry
+
+
+      IF(lwp) WRITE(numout,*) ' Initialisation of PISCES done'
+      !
+   END SUBROUTINE trc_ini
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trclsm.pisces.h90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trclsm.pisces.h90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES/trclsm.pisces.h90	(revision 764)
@@ -0,0 +1,204 @@
+   !!----------------------------------------------------------------------
+   !!                     ***  trclsm.pisces.h90  ***  
+   !! TOP :   Definition some run parameter for PISCES biological model
+   !!----------------------------------------------------------------------
+   !! History :    -  !  1999-10 (M.A. Foujols, M. Levy) original code
+   !!              -  !  2000-01 (L. Bopp) hamocc3, p3zd
+   !!             1.0 !  2003-08 (C. Ethe)  module F90
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id $ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_lsm
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_lsm  ***  
+      !!
+      !! ** Purpose :   read PISCES namelist
+      !!
+      !! ** input   :   file 'namelist.trc.sms' containing the following
+      !!             namelist: natext, natbio, natsms
+      !!                       natkriest ("key_trc_kriest")
+      !!----------------------------------------------------------------------
+      CHARACTER (len=32) ::   clname
+      !!
+      NAMELIST/natext/ atcco2
+      NAMELIST/natbio/ caco3r, kdca, nca, part,                               &
+         &             dispo0,conc0,oxymin,grosip, nrdttrc,                   &
+         &             pislope, excret,wsbio,wchl,wchld,resrat,mprat,mzrat,   &
+         &             grazrat,xprefc,xprefp,unass,xkgraz,xkmort,xksi1,       &
+         &             xksi2,xremip,xremik,xsirem,xkdoc1,xkdoc2,              &
+         &             excret2,resrat2,mprat2,mpratm,mzrat2,grazrat2,         &
+         &             xprefz, xprefpoc, unass2, xkgraz2, xlam1,              &
+         &             ferat3,conc1,conc2,conc3,concnnh4,concdnh4,            &
+         &             nitrif,epsher,epsher2,pislope2,wsbio2,sigma1,          &
+         &             sigma2, zprefc, zprefp, zprefd,fecnm,fecdm,            &
+         &             chlcnm,chlcdm, sedfeinput
+      NAMELIST/natsms/bdustfer, briver, bndepo, bsedinput
+#if defined key_trc_kriest
+      NAMELIST/natkriest/ xkr_eta  , xkr_zeta , xkr_sfact, xkr_mass_min, xkr_mass_max,   &
+         &                xkr_dnano, xkr_ddiat, xkr_dmeso, xkr_daggr   , xkr_stick
+#endif
+      !!----------------------------------------------------------------------
+
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_lsm : read PISCES namelists'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
+
+
+      !                               ! Open the namelist file
+      !                               ! ----------------------
+      clname ='namelist.trc.sms'
+      CALL ctlopn( numnat, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
+         &           1, numout, .FALSE., 1 )
+
+      !                               ! natext : Atmospheric parameters
+      !                               ! -------------------- ----------
+      REWIND( numnat )                     ! read natext
+      READ  ( numnat, natext )
+
+      IF(lwp) THEN                         ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist : natext'
+         WRITE(numout,*) '    atmospheric pCO2                         atcco2 = ',atcco2
+      ENDIF
+
+
+      !                               ! natbio : biological parameters
+      !                               ! ------------------------------
+      REWIND( numnat )                     ! read natbio
+      READ  ( numnat, natbio )
+
+      IF(lwp) THEN                         ! control print
+         WRITE(numout,*) ' Namelist : natbio'
+         WRITE(numout,*) '    mean rainratio                            caco3r    =', caco3r
+         WRITE(numout,*) '    diss. rate constant calcite (per month)   kdca      =', kdca
+         WRITE(numout,*) '    order of reaction for calcite dissolution nca       =', nca
+         WRITE(numout,*) '    part of calcite not dissolved in guts     part      =', part
+         WRITE(numout,*) '    mean Si/C ratio                           grosip    =', grosip
+         WRITE(numout,*) '    Calcite dissolution half saturation       dispo0    =', dispo0
+         WRITE(numout,*) '    Phosphate half saturation                 conc0     =', conc0
+         WRITE(numout,*) '    frequence pour la biologie                nrdttrc   =', nrdttrc
+         WRITE(numout,*) '    P-I slope                                 pislope   =', pislope
+         WRITE(numout,*) '    excretion ratio of phytoplankton          excret    =', excret
+         WRITE(numout,*) '    POC sinking speed                         wsbio     =', wsbio
+         WRITE(numout,*) '    quadratic mortality of phytoplankton      wchl      =', wchl
+         WRITE(numout,*) '    maximum quadratic mortality of diatoms    wchld     =', wchld
+         WRITE(numout,*) '    exsudation rate of zooplankton            resrat    =', resrat
+         WRITE(numout,*) '    phytoplankton mortality rate              mprat     =', mprat
+         WRITE(numout,*) '    zooplankton mortality rate                mzrat     =', mzrat
+         WRITE(numout,*) '    zoo preference for phyto                  xprefc    =', xprefc
+         WRITE(numout,*) '    zoo preference for POC                    xprefp    =', xprefp
+         WRITE(numout,*) '    maximal zoo grazing rate                  grazrat   =', grazrat
+         WRITE(numout,*) '    non assimilated fraction of phyto by zoo  unass     =', unass
+         WRITE(numout,*) '    half sturation constant for grazing       xkgraz    =', xkgraz
+         WRITE(numout,*) '    half saturation constant for mortality    xkmort    =', xkmort
+         WRITE(numout,*) '    half saturation constant for Si uptake    xksi1     =', xksi1
+         WRITE(numout,*) '    half saturation constant for Si/C         xksi2     =', xksi2
+         WRITE(numout,*) '    remineralisation rate of POC              xremip    =', xremip
+         WRITE(numout,*) '    remineralization rate of DOC              xremik    =', xremik
+         WRITE(numout,*) '    remineralization rate of Si               xsirem    =', xsirem 
+         WRITE(numout,*) '    1st half-sat. of DOC remineralization     xkdoc1    =', xkdoc1
+         WRITE(numout,*) '    2nd half-sat. of DOC remineralization     xkdoc2    =', xkdoc2
+         WRITE(numout,*) '    excretion ratio of diatoms                excret2   =', excret2
+         WRITE(numout,*) '    exsudation rate of mesozooplankton        resrat2   =', resrat2
+         WRITE(numout,*) '    Diatoms mortality rate                    mprat2    =', mprat2
+         WRITE(numout,*) '    Phytoplankton minimum mortality rate      mpratm    =', mpratm
+         WRITE(numout,*) '    mesozooplankton mortality rate            mzrat2    =', mzrat2
+         WRITE(numout,*) '    zoo preference for zoo                    xprefz    =', xprefz
+         WRITE(numout,*) '    zoo preference for poc                    xprefpoc  =', xprefpoc
+         WRITE(numout,*) '    maximal mesozoo grazing rate              grazrat2  =', grazrat2
+         WRITE(numout,*) '    non assimilated fraction of P by mesozoo  unass2    =', unass2
+         WRITE(numout,*) '    Efficicency of Mesozoo growth             epsher2   =', epsher2 
+         WRITE(numout,*) '    Efficiency of microzoo growth             epsher    =', epsher
+         WRITE(numout,*) '    half sturation constant for grazing 2     xkgraz2   =', xkgraz2
+         WRITE(numout,*) '    Maximum aggregation rate for diatoms      wchld     =', wchld
+         WRITE(numout,*) '    scavenging rate of Iron                   xlam1     =', xlam1
+         WRITE(numout,*) '    Fe/C in zooplankton                       ferat3    =', ferat3
+         WRITE(numout,*) '    Phosphate half saturation for diatoms     conc1     =', conc1
+         WRITE(numout,*) '    Iron half saturation for phyto            conc2     =', conc2
+         WRITE(numout,*) '    Iron half saturation for diatoms          conc3     =', conc3
+         WRITE(numout,*) '    NH4 half saturation for phyto             concnnh4  =', concnnh4
+         WRITE(numout,*) '    NH4 half saturation for diatoms           concdnh4  =', concdnh4
+         WRITE(numout,*) '    NH4 nitrification rate                    nitrif    =', nitrif
+         WRITE(numout,*) '    P-I slope  for diatoms                    pislope2  =', pislope2
+         WRITE(numout,*) '    Big particles sinking speed               wsbio2    =', wsbio2
+         WRITE(numout,*) '    Fraction of microzoo excretion as DOM     sigma1    =', sigma1
+         WRITE(numout,*) '    Fraction of mesozoo excretion as DOM      sigma2    =', sigma2
+         WRITE(numout,*) '    Microzoo preference for POM               zprefc    =', zprefc
+         WRITE(numout,*) '    Microzoo preference for Nanophyto         zprefp    =', zprefp
+         WRITE(numout,*) '    Microzoo preference for Diatoms           zprefd    =', zprefd
+         WRITE(numout,*) '    Minimum Chl/C in nanophytoplankton        chlcnm    =', chlcnm
+         WRITE(numout,*) '    Minimum Chl/C in diatoms                  chlcdm    =', chlcdm
+         WRITE(numout,*) '    Maximum Fe/C in nanophytoplankton         fecnm     =', fecnm
+         WRITE(numout,*) '    Minimum Fe/C in diatoms                   fecdm     =', fecdm
+         WRITE(numout,*) '    Coastal release of Iron                   sedfeinput=', sedfeinput
+      ENDIF
+
+      !                               ! natsms : SMS parameters
+      !                               ! -----------------------
+      REWIND( numnat )                     ! read natsms
+      READ  ( numnat, natsms )
+      IF(lwp) THEN
+         WRITE(numout,*) ' '
+         WRITE(numout,*) ' Namelist : natsms'
+         WRITE(numout,*) '    Dust input from the atmosphere           bdustfer  = ', bdustfer
+         WRITE(numout,*) '    River input of nutrients                 briver    = ', briver
+         WRITE(numout,*) '    Atmospheric deposition of N              bndepo    = ', bndepo
+         WRITE(numout,*) '    Fe input from sediments                  bsedinput = ', bsedinput
+      ENDIF
+
+#if defined key_trc_kriest
+
+      !                               ! natkriest : kriest parameters
+      !                               ! -----------------------------
+      REWIND( numnat )                     ! read natkriest
+      READ  ( numnat, natkriest )
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) ' Namelist : natkriest'
+         WRITE(numout,*) '    Sinking  exponent                        xkr_eta      = ', xkr_eta 
+         WRITE(numout,*) '    N content exponent                       xkr_zeta     = ', xkr_zeta
+         WRITE(numout,*) '    Sinking factor                           xkr_sfact    = ', xkr_sfact
+         WRITE(numout,*) '    Stickiness                               xkr_stick    = ', xkr_stick
+         WRITE(numout,*) '    Minimum mass for Aggregates              xkr_mass_min = ', xkr_mass_min
+         WRITE(numout,*) '    Maximum mass for Aggregates              xkr_mass_max = ', xkr_mass_max
+         WRITE(numout,*) '    Size of particles in nano pool           xkr_dnano    = ', xkr_dnano
+         WRITE(numout,*) '    Size of particles in diatoms pool        xkr_ddiat    = ', xkr_ddiat
+         WRITE(numout,*) '    Size of particles in mesozoo pool        xkr_dmeso    = ', xkr_dmeso
+         WRITE(numout,*) '    Size of particles in aggregates pool     xkr_daggr    = ', xkr_daggr
+     ENDIF
+
+
+     ! Computation of some variables
+     xkr_massp = 5.7E-6 * 7.6 * xkr_mass_min**xkr_zeta
+     
+     ! max and min vertical particle speed
+     xkr_wsbio_min = xkr_sfact * xkr_mass_min**xkr_eta
+     xkr_wsbio_max = xkr_sfact * xkr_mass_max**xkr_eta
+     WRITE(numout,*) ' max and min vertical particle speed ', xkr_wsbio_min, xkr_wsbio_max
+     
+     !
+     !    effect of the sizes of the different living pools on particle numbers
+     !    nano = 2um-20um -> mean size=6.32 um -> ws=2.596 -> xnum=xnnano=2.337
+     !    diat and microzoo = 10um-200um -> 44.7 -> 8.732 -> xnum=xndiat=3.718
+     !    mesozoo = 200um-2mm -> 632.45 -> 45.14 -> xnum=xnmeso=7.147
+     !    aggregates = 200um-10mm -> 1414 -> 74.34 -> xnum=xnaggr=9.877
+     !    doc aggregates = 1um
+     ! ----------------------------------------------------------
+
+     xkr_nnano = 1. / ( xkr_massp * xkr_dnano )
+     xkr_ndiat = 1. / ( xkr_massp * xkr_ddiat )
+     xkr_nmeso = 1. / ( xkr_massp * xkr_dmeso )
+     xkr_naggr = 1. / ( xkr_massp * xkr_daggr )
+    
+#endif
+      !
+   END SUBROUTINE trc_lsm
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.F	(revision 764)
@@ -0,0 +1,438 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+      SUBROUTINE p4zbio
+CDIR$ LIST
+#if defined key_passivetrc && defined key_trc_pisces
+CCC   ------------------------------------------------------------------
+CCC   
+CCC   ROUTINE p4zbio : PISCES MODEL
+CCC   *****************************
+CCC   
+CC
+CC     PURPOSE.
+CC     --------
+CC          *P4ZBIO* ECOSYSTEM MODEL IN THE WHOLE OCEAN
+CC                   THIS ROUTINE COMPUTES THE DIFFERENT INTERACTIONS
+CC                   BETWEEN THE DIFFERENT COMPARTMENTS OF THE MODEL
+CC     EXTERNAL :
+CC     ----------
+CC          p4zopt, p4zprod, p4znano, p4zdiat, p4zmicro, p4zmeso
+CC          p4zsink, p4zrem
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original      : 2004    O. Aumont
+CC ----------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC-----------------------------------------------------------------
+CC local declarations
+CC ==================
+C     
+      INTEGER ji, jj, jk, jn
+
+      REAL zdenom,zdenom1(jpi,jpj,jpk)
+      REAL prodca,ztemp
+
+#if ! defined key_trc_kriest
+      REAL zdenom2(jpi,jpj,jpk)
+#else
+      REAL znumpoc, znumdoc
+#endif
+C     
+      REAL prodt
+      REAL zfracal(jpi,jpj,jpk)
+C
+C     ASSIGN THE SHEAR RATE THAT IS USED FOR AGGREGATION
+C     OF PHYTOPLANKTON AND DETRITUS
+C
+       zdiss(:,:,:) = 0.01
+C
+      DO jk=1,jpkm1
+        DO jj=1,jpj
+          DO ji=1,jpi
+       if (fsdepw(ji,jj,jk+1).le.hmld(ji,jj)) zdiss(ji,jj,jk)=1.
+          END DO 
+        END DO
+      END DO
+C
+C      Compute de different ratios for scavenging of iron
+C      --------------------------------------------------
+C
+       DO jk=1,jpk
+         DO jj=1,jpj
+           DO ji=1,jpi
+#if ! defined key_trc_kriest
+         zdenom=1./(trn(ji,jj,jk,jppoc)+trn(ji,jj,jk,jpgoc)
+     $     +trn(ji,jj,jk,jpdsi)+trn(ji,jj,jk,jpcal)+rtrn)
+C
+         zdenom1(ji,jj,jk)=trn(ji,jj,jk,jppoc)*zdenom
+         zdenom2(ji,jj,jk)=trn(ji,jj,jk,jpgoc)*zdenom
+
+#else
+         zdenom=1./(trn(ji,jj,jk,jppoc)
+     $     +trn(ji,jj,jk,jpdsi)+trn(ji,jj,jk,jpcal)+rtrn)
+         zdenom1(ji,jj,jk)=trn(ji,jj,jk,jppoc)*zdenom
+
+#endif
+           END DO
+         END DO
+       END DO
+C
+C     Compute the fraction of nanophytoplankton that is made
+C     of calcifiers
+C     ------------------------------------------------------
+C
+       DO jk=1,jpkm1
+         DO jj=1,jpj
+           DO ji=1,jpi
+       ztemp=max(0.,tn(ji,jj,jk))
+       zfracal(ji,jj,jk)=caco3r*xlimphy(ji,jj,jk)*max(0.0001
+     &   ,ztemp/(2.+ztemp))*max(1.,trn(ji,jj,jk,jpphy)*1E6/2.)
+       zfracal(ji,jj,jk)=min(0.8,zfracal(ji,jj,jk))
+       zfracal(ji,jj,jk)=max(0.01,zfracal(ji,jj,jk))
+           END DO
+         END DO
+       END DO
+
+C
+C     Call subroutine for computation of the vertical flux
+C     of particulate organic matter
+C     ----------------------------------------------------
+C
+      CALL p4zsink
+
+C
+C  Call optical routine to compute the PAR in the water column
+C  -----------------------------------------------------------
+C
+      CALL p4zopt
+C
+C  Call routine to compute the co-limitations by the various
+C  nutrients
+C  ---------------------------------------------------------
+C
+      CALL p4zlim
+C
+C  Call production routine to compute phytoplankton growth rate
+C  over the global ocean. Growth rates for each element is 
+C  computed (C, Si, Fe, Chl)
+C  ------------------------------------------------------------
+C
+      CALL p4zprod
+C
+C  Call phytoplankton mortality routines. Mortality losses for 
+C  Each elements are computed (C, Fe, Si, Chl)
+C  -----------------------------------------------------------
+C
+      CALL p4znano
+      CALL p4zdiat
+C
+C  Call zooplankton sources/sinks routines. 
+C  Each elements are computed (C, Fe, Si, Chl)
+C  -----------------------------------------------------------
+C
+      CALL p4zmicro
+      CALL p4zmeso
+
+C 
+C     Call subroutine for computation of remineralization
+C     terms of organic matter+scavenging of Fe
+C     ----------------------------------------------------
+      CALL p4zrem
+C     
+C     Determination of tracers concentration as a function of 
+C     biological sources and sinks
+C     --------------------------------------------------------
+C     
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C     
+C     Evolution of PO4
+C     ----------------
+C     
+          trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4)
+     &      -prorca(ji,jj,jk)-prorca2(ji,jj,jk)
+     &      +olimi(ji,jj,jk)+grarem(ji,jj,jk)*sigma1+denitr(ji,jj,jk)
+     &      +grarem2(ji,jj,jk)*sigma2
+C
+C     Evolution of NO3 and NH4
+C     ------------------------
+C
+          trn(ji,jj,jk,jpno3) = trn(ji,jj,jk,jpno3)
+     &      -pronew(ji,jj,jk)-pronew2(ji,jj,jk)+onitr(ji,jj,jk)
+     &      -denitr(ji,jj,jk)*rdenit
+
+          trn(ji,jj,jk,jpnh4) = trn(ji,jj,jk,jpnh4)
+     &      -proreg(ji,jj,jk)-proreg2(ji,jj,jk)+olimi(ji,jj,jk)
+     &      +grarem(ji,jj,jk)*sigma1+grarem2(ji,jj,jk)*sigma2
+     &      -onitr(ji,jj,jk)+denitr(ji,jj,jk)
+
+          END DO
+        END DO
+      END DO
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+
+C    
+C     Evolution of Phytoplankton
+C     --------------------------
+C     
+          trn(ji,jj,jk,jpphy) = trn(ji,jj,jk,jpphy)
+     &      +prorca(ji,jj,jk)*(1.-excret)-tortp(ji,jj,jk)
+     &      -grazp(ji,jj,jk)-grazn(ji,jj,jk)-respp(ji,jj,jk)
+
+          trn(ji,jj,jk,jpnch) = trn(ji,jj,jk,jpnch)
+     &      +prorca6(ji,jj,jk)*(1.-excret)-tortnch(ji,jj,jk)
+     &      -grazpch(ji,jj,jk)-graznch(ji,jj,jk)-respnch(ji,jj,jk)
+C
+C     Evolution of Diatoms
+C     ------------------
+C
+          trn(ji,jj,jk,jpdia) = trn(ji,jj,jk,jpdia)
+     &      +prorca2(ji,jj,jk)*(1.-excret2)-tortp2(ji,jj,jk)
+     &      -respp2(ji,jj,jk)-grazd(ji,jj,jk)-grazsd(ji,jj,jk)
+
+          trn(ji,jj,jk,jpdch) = trn(ji,jj,jk,jpdch)
+     &      +prorca7(ji,jj,jk)*(1.-excret2)-tortdch(ji,jj,jk)
+     &      -respdch(ji,jj,jk)-grazdch(ji,jj,jk)-grazsch(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C    
+C     Evolution of Zooplankton
+C     ------------------------
+C     
+          trn(ji,jj,jk,jpzoo) = trn(ji,jj,jk,jpzoo)
+     &      +epsher*(grazp(ji,jj,jk)+grazm(ji,jj,jk)+grazsd(ji,jj,jk))
+     &      -grazz(ji,jj,jk)-tortz(ji,jj,jk)-respz(ji,jj,jk)
+C
+C     Evolution of Mesozooplankton
+C     ------------------------
+C
+          trn(ji,jj,jk,jpmes) = trn(ji,jj,jk,jpmes)
+     &      +epsher2*(grazd(ji,jj,jk)+grazz(ji,jj,jk)+grazn(ji,jj,jk)
+     &      +grazpoc(ji,jj,jk)+grazffe(ji,jj,jk))-tortz2(ji,jj,jk)
+     &      -respz2(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C    
+C     Evolution of O2
+C     ---------------
+C     
+         trn(ji,jj,jk,jpoxy) = trn(ji,jj,jk,jpoxy)
+     &     +o2ut*(proreg(ji,jj,jk)+proreg2(ji,jj,jk)-olimi(ji,jj,jk)
+     &     -grarem(ji,jj,jk)*sigma1-grarem2(ji,jj,jk)*sigma2)
+     &     +(o2ut+o2nit)*( pronew(ji,jj,jk)+pronew2(ji,jj,jk))
+     &     -o2nit*onitr(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of IRON
+C     -----------------
+C
+          trn(ji,jj,jk,jpfer) = trn(ji,jj,jk,jpfer)
+     &      +(excret-1.)*prorca5(ji,jj,jk)-xaggdfe(ji,jj,jk)
+     &      +(excret2-1.)*prorca4(ji,jj,jk)-xbactfer(ji,jj,jk)
+     &      +grafer(ji,jj,jk)+grafer2(ji,jj,jk)
+     &      +ofer(ji,jj,jk)-xscave(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+
+
+#if defined key_trc_kriest
+
+#include "p4zbio.kriest.h"
+
+#else
+
+#include "p4zbio.std.h"
+
+#endif
+
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of biogenic Silica
+C     ----------------------------
+C
+          trn(ji,jj,jk,jpbsi) = trn(ji,jj,jk,jpbsi)
+     &      +prorca3(ji,jj,jk)*(1.-excret2)-grazss(ji,jj,jk)
+     &      -tortds(ji,jj,jk)-respds(ji,jj,jk)-grazs(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of sinking biogenic silica
+C     ------------------------------------
+C
+          trn(ji,jj,jk,jpdsi)=trn(ji,jj,jk,jpdsi)
+     &      +tortds(ji,jj,jk)+respds(ji,jj,jk)+grazs(ji,jj,jk)
+     &      -osil(ji,jj,jk)+grazss(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of biogenic diatom Iron
+C     ---------------------------------
+C
+          trn(ji,jj,jk,jpdfe) = trn(ji,jj,jk,jpdfe)
+     &      +prorca4(ji,jj,jk)*(1.-excret2)-grazsf(ji,jj,jk)
+     &      -tortdf(ji,jj,jk)-respdf(ji,jj,jk)-grazf(ji,jj,jk)
+C
+C     Evolution of biogenic nanophytoplankton Iron
+C     --------------------------------------------
+C
+          trn(ji,jj,jk,jpnfe) = trn(ji,jj,jk,jpnfe)
+     &      +prorca5(ji,jj,jk)*(1.-excret)-graznf(ji,jj,jk)
+     &      -tortnf(ji,jj,jk)-respnf(ji,jj,jk)-grazpf(ji,jj,jk)
+C
+C     Evolution of dissolved Silica
+C     -----------------------------
+C
+          trn(ji,jj,jk,jpsil) = trn(ji,jj,jk,jpsil)
+     &      -(1.-excret2)*prorca3(ji,jj,jk)+osil(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+C     
+C     Evolution of calcite and silicates as a function of the two tracers
+C     -------------------------------------------------------------------
+C     
+      DO  jk = 1,jpkm1
+        DO  jj = 1,jpj
+          DO  ji = 1,jpi
+C
+          prodt = prorca(ji,jj,jk)+prorca2(ji,jj,jk)
+     &      -olimi(ji,jj,jk)-grarem(ji,jj,jk)*sigma1
+     &      -grarem2(ji,jj,jk)*sigma2-denitr(ji,jj,jk)
+
+          prodca = pronew(ji,jj,jk)+pronew2(ji,jj,jk)
+     &      -onitr(ji,jj,jk)+rdenit*denitr(ji,jj,jk)
+C     
+C     potential production of calcite and biogenic silicate
+C     ------------------------------------------------------
+C     
+          prcaca(ji,jj,jk)=
+     &      zfracal(ji,jj,jk)*(part*(unass*grazp(ji,jj,jk)+
+     &      unass2*grazn(ji,jj,jk))+tortp(ji,jj,jk)+respp(ji,jj,jk))
+C     
+C     Consumption of Total (12C)O2
+C     ----------------------------
+C     
+          trn(ji,jj,jk,jpdic) = trn(ji,jj,jk,jpdic)
+     &      -prodt-prcaca(ji,jj,jk)
+C     
+C     Consumption of alkalinity due to ca++ uptake and increase 
+C     of alkalinity due to nitrate consumption during organic 
+C     soft tissue production
+C     ---------------------------------------------------------
+C     
+          trn(ji,jj,jk,jptal) = trn(ji,jj,jk,jptal)
+     &      +rno3*prodca-2.*prcaca(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+C
+      DO  jk = 1,jpkm1
+        DO  jj = 1,jpj
+          DO  ji = 1,jpi
+C
+C     Production of calcite due to biological production
+C     --------------------------------------------------
+C     
+           trn(ji,jj,jk,jpcal) = trn(ji,jj,jk,jpcal)
+     &        +prcaca(ji,jj,jk)
+          END DO
+        END DO
+      ENDDO
+C
+C
+C     Loop to test if tracers concentrations fall below 0.
+C     ----------------------------------------------------
+C
+C
+      znegtr(:,:,:) = 1.
+C
+      DO jn = 1,jptra
+        DO jk = 1,jpk
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+              if (trn(ji,jj,jk,jn).lt.0.) then
+               znegtr(ji,jj,jk)=0.
+              endif
+            END DO
+          END DO
+        END DO
+      END DO
+C
+      DO jn = 1,jptra
+         trn(:,:,:,jn) = trb(:,:,:,jn)+
+     &     znegtr(:,:,:)*(trn(:,:,:,jn)-trb(:,:,:,jn))
+      END DO
+C
+#    if defined key_trc_dia3d
+          trc3d(:,:,:,4)=etot(:,:,:)
+          trc3d(:,:,:,5)=prorca(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+          trc3d(:,:,:,6)=prorca2(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+          trc3d(:,:,:,7)=pronew(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+          trc3d(:,:,:,8)=pronew2(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+          trc3d(:,:,:,9)=prorca3(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+          trc3d(:,:,:,10)=prorca4(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+#if ! defined key_trc_kriest
+          trc3d(:,:,:,11)=prorca5(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+#else
+          trc3d(:,:,:,11)=prcaca(:,:,:)*znegtr(:,:,:)*1e3*rfact2r
+#endif
+#    endif
+C     
+#endif
+C     
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.kriest.h
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.kriest.h	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.kriest.h	(revision 764)
@@ -0,0 +1,93 @@
+
+
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+CCC p4zbio : PISCES MODEL  - Kriest parameterization
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C    
+C     Evolution of DOC
+C     ----------------
+C     
+          trn(ji,jj,jk,jpdoc) = trn(ji,jj,jk,jpdoc)
+     &      +orem(ji,jj,jk)+excret2*prorca2(ji,jj,jk)
+     &      +excret*prorca(ji,jj,jk)-olimi(ji,jj,jk)-denitr(ji,jj,jk)
+     &      +grarem(ji,jj,jk)*(1.-sigma1)+grarem2(ji,jj,jk)
+     &      *(1.-sigma2)-xaggdoc(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C     
+C     Evolution of Detritus
+C     ---------------------
+C  
+            znumpoc=trn(ji,jj,jk,jpnum)/(trn(ji,jj,jk,jppoc)+rtrn)
+            znumdoc=znumpoc
+
+            trn(ji,jj,jk,jppoc) = trn(ji,jj,jk,jppoc)
+     &          -grazpoc(ji,jj,jk)
+     &          +grapoc(ji,jj,jk)+grapoc2(ji,jj,jk)
+     &          -grazm(ji,jj,jk)+tortz2(ji,jj,jk)
+     &          +respz(ji,jj,jk)+respz2(ji,jj,jk)
+     &          +respp(ji,jj,jk)+respp2(ji,jj,jk)
+     &          +tortp2(ji,jj,jk)+tortz(ji,jj,jk)
+     &          +tortp(ji,jj,jk)-orem(ji,jj,jk)
+     &          +xaggdoc(ji,jj,jk)-grazffe(ji,jj,jk)
+C    
+C     Evolution of number of aggregates
+C     ---------------------------------
+C
+            trn(ji,jj,jk,jpnum) = trn(ji,jj,jk,jpnum)
+     &          -xagg(ji,jj,jk)-(orem(ji,jj,jk)
+     &          +grazpoc(ji,jj,jk))*znumpoc
+     &          +(tortp(ji,jj,jk))*xkr_nnano
+     &          +(tortp2(ji,jj,jk)+respp(ji,jj,jk)+tortz(ji,jj,jk)
+     &          +grapoc(ji,jj,jk)-grazm(ji,jj,jk)
+     &          +respz(ji,jj,jk))*xkr_ndiat
+     &          +(grapoc2(ji,jj,jk)+tortz2(ji,jj,jk)
+     &          +respz2(ji,jj,jk))*xkr_nmeso
+     &          +respp2(ji,jj,jk)*xkr_naggr
+     &          +xaggdoc(ji,jj,jk)*znumdoc
+     &          -grazffe(ji,jj,jk)*znumpoc*wsbio4(ji,jj,jk)
+     &          /(wsbio3(ji,jj,jk)+rtrn)
+C
+            trn(ji,jj,jk,jpnum) = max(trn(ji,jj,jk,jpnum),
+     &          trn(ji,jj,jk,jppoc)/xkr_massp/xnumm(jk))
+C
+            trn(ji,jj,jk,jpnum) = min(trn(ji,jj,jk,jpnum),
+     &          trn(ji,jj,jk,jppoc)/xkr_massp/1.1)
+C
+
+          END DO
+        END DO
+      END DO
+
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of biogenic Iron
+C     --------------------------
+C
+          trn(ji,jj,jk,jpsfe) = trn(ji,jj,jk,jpsfe)
+     &     +unass*(grazpf(ji,jj,jk)+grazsf(ji,jj,jk))
+     &     -(1.-unass2)*grazpof(ji,jj,jk)-(1.-unass)*grazmf(ji,jj,jk)
+     &     -(1.-unass2)*grazfff(ji,jj,jk)+unass2*(graznf(ji,jj,jk)
+     &     +grazf(ji,jj,jk)+ferat3*grazz(ji,jj,jk))+ferat3
+     &     *(tortz2(ji,jj,jk)+respz2(ji,jj,jk)+tortz(ji,jj,jk)
+     &     +respz(ji,jj,jk))-ofer(ji,jj,jk)+(respnf(ji,jj,jk)
+     &     +tortnf(ji,jj,jk))+tortdf(ji,jj,jk)+respdf(ji,jj,jk)
+     &     +xbactfer(ji,jj,jk)+xscave(ji,jj,jk)*zdenom1(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.std.h
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.std.h	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zbio.std.h	(revision 764)
@@ -0,0 +1,80 @@
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+CCC p4zbio : PISCES MODEL  - Standard parameterization
+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C    
+C     Evolution of DOC
+C     ----------------
+C     
+          trn(ji,jj,jk,jpdoc) = trn(ji,jj,jk,jpdoc)
+     &      +orem(ji,jj,jk)+excret2*prorca2(ji,jj,jk)
+     &      +excret*prorca(ji,jj,jk)-olimi(ji,jj,jk)-denitr(ji,jj,jk)
+     &      +grarem(ji,jj,jk)*(1.-sigma1)+grarem2(ji,jj,jk)
+     &      *(1.-sigma2)-xaggdoc(ji,jj,jk)-xaggdoc2(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C     
+C     Evolution of Detritus
+C     ---------------------
+C     
+          trn(ji,jj,jk,jppoc) = trn(ji,jj,jk,jppoc)
+     &     -grazpoc(ji,jj,jk)+grapoc(ji,jj,jk)-grazm(ji,jj,jk)
+     &     +respz(ji,jj,jk)-xagg(ji,jj,jk)+xaggdoc(ji,jj,jk)
+     &     +(1.-0.5*zfracal(ji,jj,jk))*(tortp(ji,jj,jk)
+     &     +respp(ji,jj,jk))+0.5*tortp2(ji,jj,jk)
+     &     +orem2(ji,jj,jk)+tortz(ji,jj,jk)-orem(ji,jj,jk)
+C    
+C     Evolution of rapid Detritus
+C     ---------------------
+C    
+          trn(ji,jj,jk,jpgoc) = trn(ji,jj,jk,jpgoc)
+     &     +grapoc2(ji,jj,jk)+respp2(ji,jj,jk)+xagg(ji,jj,jk)
+     &     +tortz2(ji,jj,jk)+respz2(ji,jj,jk)-orem2(ji,jj,jk)
+     &     +0.5*zfracal(ji,jj,jk)*(respp(ji,jj,jk)+tortp(ji,jj,jk))
+     &     +0.5*tortp2(ji,jj,jk)+xaggdoc2(ji,jj,jk)-grazffe(ji,jj,jk)
+C
+          END DO
+        END DO
+      END DO
+
+
+
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C     Evolution of small biogenic Iron
+C     --------------------------
+C
+          trn(ji,jj,jk,jpsfe) = trn(ji,jj,jk,jpsfe)
+     &     +unass*(grazpf(ji,jj,jk)+grazsf(ji,jj,jk))
+     &     -grazpof(ji,jj,jk)-(1.-unass)*grazmf(ji,jj,jk)
+     &     +(1.-0.5*zfracal(ji,jj,jk))*(tortnf(ji,jj,jk)
+     &     +respnf(ji,jj,jk))+0.5*tortdf(ji,jj,jk)+ferat3*
+     &     (tortz(ji,jj,jk)+respz(ji,jj,jk))-ofer(ji,jj,jk)
+     &     +ofer2(ji,jj,jk)-xaggfe(ji,jj,jk)
+     &     +xscave(ji,jj,jk)*zdenom1(ji,jj,jk)
+C
+C     Evolution of big biogenic Iron
+C     --------------------------
+C
+          trn(ji,jj,jk,jpbfe) = trn(ji,jj,jk,jpbfe)
+     &     +unass2*(graznf(ji,jj,jk)+grazf(ji,jj,jk)+grazfff(ji,jj,jk)
+     &     +grazpof(ji,jj,jk)+ferat3*grazz(ji,jj,jk))+ferat3*
+     &     (tortz2(ji,jj,jk)+respz2(ji,jj,jk))-ofer2(ji,jj,jk)
+     &     +0.5*zfracal(ji,jj,jk)*(respnf(ji,jj,jk)+tortnf(ji,jj,jk))
+     &     +0.5*tortdf(ji,jj,jk)+respdf(ji,jj,jk)+xaggfe(ji,jj,jk)
+     &     +xbactfer(ji,jj,jk)-grazfff(ji,jj,jk)+xscave(ji,jj,jk)
+     &     *zdenom2(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zche.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zche.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zche.F	(revision 764)
@@ -0,0 +1,310 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zche
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zche : PISCES MODEL
+CCC          *****************************
+CCC
+CCC     PURPOSE.
+CCC     --------
+CCC          *P4ZCHE* : Sea water chemistry computed following OCMIP protocol
+CCC
+CCC
+CC     EXTERNALS.
+CC     ----------
+CC          rhop
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original :      1988 E. Maier-Reimer
+CC      additions :     1998 O. Aumont
+CC      modifications : 1999 C. Le Quere
+CC      modifications : 2004 O. Aumont
+CC      modifications : 2006 R. Gangsto
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ nolist
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ list
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER ji, jj, jk
+      REAL tkel, sal,  qtt, zbuf1, zbuf2
+      REAL pres, tc, cl, cpexp, cek0, oxy, cpexp2
+      REAL zsqrt, ztr, zlogt, cek1
+      REAL zqtt, qtt2, sal15, zis, zis2, zisqrt
+      REAL ckb, ck1, ck2, ckw, ak1, ak2, akb, aksp0, akw
+      REAL ckp1, ckp2, ckp3, cksi, akp1, akp2, akp3, aksi
+      REAL st, ft, cks, ckf, aks, akf, aksp1
+
+C
+C* 1. CHEMICAL CONSTANTS - SURFACE LAYER
+C ---------------------------------------
+C
+      DO jj = 1,jpj
+        DO ji = 1,jpi
+C
+C* 1.1 SET ABSOLUTE TEMPERATURE
+C ------------------------------
+C
+          tkel = tn(ji,jj,1)+273.16
+          qtt = tkel*0.01
+          qtt2=qtt*qtt
+          sal = sn(ji,jj,1) + (1.-tmask(ji,jj,1))*35.
+          zqtt=log(qtt)
+C
+C* 1.2 LN(K0) OF SOLUBILITY OF CO2 (EQ. 12, WEISS, 1980)
+C      AND FOR THE ATMOSPHERE FOR NON IDEAL GAS
+C -------------------------------------------------------
+C
+          cek0 = c00+c01/qtt+c02*zqtt+sal*(c03+c04*qtt+c05*qtt2)
+          cek1 = ca0+ca1/qtt+ca2*zqtt+ca3*qtt2+sal*(ca4
+     &      +ca5*qtt+ca6*qtt2)
+C
+C* 1.3 LN(K0) OF SOLUBILITY OF O2 and N2 (EQ. 4, WEISS, 1970)
+C ------------------------------------------------------------
+C
+          oxy = ox0+ox1/qtt+ox2*zqtt+sal*(ox3+ox4*qtt+ox5*qtt2)
+C
+C* 1.4 SET SOLUBILITIES OF O2 AND CO2
+C -----------------------------------
+C
+          chemc(ji,jj,1) = exp(cek0)*1.E-6*rhop(ji,jj,1)/1000.
+          chemc(ji,jj,2) = exp(oxy)*oxyco
+          chemc(ji,jj,3) = exp(cek1)*1.E-6*rhop(ji,jj,1)/1000.
+C
+        ENDDO
+      END DO
+C
+C* 2 CHEMICAL CONSTANTS - DEEP OCEAN
+C -------------------------------------
+C
+      DO jk = 1,jpk
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C* 2.1 SET PRESSION
+C -----------------
+C
+            pres = 1.025e-1*fsdept(ji,jj,jk)
+C
+C* 2.2 SET ABSOLUTE TEMPERATURE
+C ------------------------------
+C
+            tkel   = tn(ji,jj,jk)+273.16
+            qtt    = tkel*0.01
+            sal    = sn(ji,jj,jk) + (1.-tmask(ji,jj,jk))*35.
+            zsqrt  = sqrt(sal)
+            sal15  = zsqrt*sal
+            zlogt  = log(tkel)
+            ztr    = 1./tkel
+            zis    = 19.924*sal/(1000.-1.005*sal)
+            zis2   = zis*zis
+            zisqrt = sqrt(zis)
+            tc = tn(ji,jj,jk) + (1.-tmask(ji,jj,jk))*20.
+C
+C* 2.3 CHLORINITY (WOOSTER ET AL., 1969)
+C ---------------------------------------
+C
+            cl = sal*salchl
+C
+C* 2.4 TOTAL SULFATE CONCENTR. [MOLES/kg soln]
+C --------------------------------------------
+C
+            st = st1*cl*st2
+C
+C* 2.5 TOTAL FLUORIDE CONCENTR. [MOLES/kg soln]
+C ---------------------------------------------
+C
+            ft = ft1*cl*ft2
+C
+C* 2.6 DISSOCIATION CONSTANT FOR SULFATES
+C on free H scale (Dickson 1990)
+C -------------------------------------------------------
+C
+            cks=exp(ks1*ztr+ks0+ks2*zlogt+(ks3*ztr+ks4+ks5*zlogt)
+     &      *zisqrt+(ks6*ztr+ks7+ks8*zlogt)*zis+ks9*ztr*zis
+     &      *zisqrt+ks10*ztr*zis2+log(ks11+ks12*sal))
+C
+C* 2.7 DISSOCIATION CONSTANT FOR FLUORIDES
+C on free H scale (Dickson and Riley 79)
+C -------------------------------------------------------
+C
+            ckf=exp(kf1*ztr+kf0+kf2*zisqrt+log(kf3+kf4*sal))
+
+C
+C* 2.4 DISSOCIATION CONSTANT FOR CARBONATE AND BORATE
+C -------------------------------------------------------
+C
+            ckb = (cb0+cb1*zsqrt+cb2*sal+cb3*sal15+cb4*sal*sal)*ztr
+     &          +(cb5+cb6*zsqrt+cb7*sal)+
+     &          (cb8+cb9*zsqrt+cb10*sal)*zlogt+cb11*zsqrt*tkel
+     &          +log((1.+st/cks+ft/ckf)/(1.+st/cks))
+            ck1 = c10*ztr+c11+c12*zlogt+c13*sal+c14*sal**2
+            ck2 = c20*ztr+c21+c22*sal+c23*sal**2
+C
+C* 2.5 PKW (H2O) (DICKSON AND RILEY, 1979)
+C -----------------------------------------
+C
+            ckw = cw0*ztr+cw1+cw2*zlogt+(cw3*ztr+cw4+cw5*zlogt)*
+     &          zsqrt+cw6*sal
+
+C
+C
+C* 2.10 DISSOCIATION CONSTANT FOR PHOSPHATE AND SILICATE (seawater scale)
+C  ---------------------------------------------------------------------
+C
+            ckp1 = cp10+cp11*ztr+cp12*zlogt+zsqrt*(cp13*ztr
+     &           +cp14)+sal*(cp15*ztr+cp16)
+            ckp2 = cp20+cp21*ztr+cp22*zlogt+zsqrt*(cp23*ztr
+     &           +cp24)+sal*(cp25*ztr+cp26)
+            ckp3 = cp30+cp31*ztr+zsqrt*(cp32*ztr
+     &           +cp33)+sal*(cp34*ztr+cp35)
+            cksi = cs10+cs11*ztr+cs12*zlogt+zisqrt*(cs13*ztr
+     &           +cs14)+zis*(cs15*ztr+cs16)+zis2*(cs17*ztr
+     &           +cs18)+log(1.+cs19*sal)
+     &           +log(cs20+cs21*sal)
+
+C
+C*2.7 APPARENT SOLUBILITY PRODUCT K'SP OF CALCITE IN SEAWATER
+C       (S=27-43, T=2-25 DEG C) AT pres =0 (ATMOSPH. PRESSURE)
+C       (MUCCI 1983)
+C -------------------------------------------------------------
+C
+            aksp0 = akcc1+akcc2*tkel+akcc3*ztr+akcc4*log10(tkel)+
+     &      (akcc5+akcc6*tkel+
+     &      akcc7*ztr)*zsqrt+akcc8*sal+akcc9*sal15
+
+
+C
+C* 2.6 K1, K2 OF CARBONIC ACID, KB OF BORIC ACID, KW (H2O) (LIT.?)
+C -----------------------------------------------------------------
+C
+            ak1   = 10**(ck1)
+            ak2   = 10**(ck2)
+            akb   = exp(ckb)
+            akp1  = exp(ckp1)
+            akp2  = exp(ckp2)
+            akp3  = exp(ckp3)
+            aksi  = exp(cksi)
+            akw   = exp(ckw)
+            aksp1 = 10**(aksp0)
+            aks   = exp(cks)
+            akf   = exp(ckf)
+
+
+C
+C* 2.8 FORMULA FOR CPEXP AFTER EDMOND AND GIESKES (1970)
+C        (REFERENCE TO CULBERSON AND PYTKOQICZ (1968) AS MADE
+C        IN BROECKER ET AL. (1982) IS INCORRECT; HERE RGAS IS
+C        TAKEN TENFOLD TO CORRECT FOR THE NOTATION OF pres  IN
+C        DBAR INSTEAD OF BAR AND THE EXPRESSION FOR CPEXP IS
+C        MULTIPLIED BY LN(10.) TO ALLOW USE OF EXP-FUNCTION
+C        WITH BASIS E IN THE FORMULA FOR AKSPP (CF. EDMOND
+C        AND GIESKES (1970), P. 1285 AND P. 1286 (THE SMALL
+C        FORMULA ON P. 1286 IS RIGHT AND CONSISTENT WITH THE
+C        SIGN IN PARTIAL MOLAR VOLUME CHANGE AS SHOWN ON
+C        P. 1285))
+C -----------------------------------------------------------
+C
+            cpexp = pres /(rgas*tkel)
+            cpexp2 = pres * pres/(rgas*tkel)
+C
+C* 2.9 KB OF BORIC ACID, K1,K2 OF CARBONIC ACID PRESSURE
+C        CORRECTION AFTER CULBERSON AND PYTKOWICZ (1968)
+C        (CF. BROECKER ET AL., 1982)
+C --------------------------------------------------------
+C
+            zbuf1 = -(devk1(3)+devk2(3)*tc+devk3(3)*tc*tc)
+            zbuf2 = 0.5*(devk4(3)+devk5(3)*tc)
+            akb3(ji,jj,jk) = akb*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(1)+devk2(1)*tc+devk3(1)*tc*tc)
+            zbuf2 = 0.5*(devk4(1)+devk5(1)*tc)
+            ak13(ji,jj,jk) = ak1*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(2)+devk2(2)*tc+devk3(2)*tc*tc)
+            zbuf2 = 0.5*(devk4(2)+devk5(2)*tc)
+            ak23(ji,jj,jk) = ak2*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(4)+devk2(4)*tc+devk3(4)*tc*tc)
+            zbuf2 = 0.5*(devk4(4)+devk5(4)*tc)
+            akp13(ji,jj,jk) = akp1*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(5)+devk2(5)*tc+devk3(5)*tc*tc)
+            zbuf2 = 0.5*(devk4(5)+devk5(5)*tc)
+            akp23(ji,jj,jk) = akp2*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(6)+devk2(6)*tc+devk3(6)*tc*tc)
+            zbuf2 = 0.5*(devk4(6)+devk5(6)*tc)
+            akp33(ji,jj,jk) = akp3*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(7)+devk2(7)*tc+devk3(7)*tc*tc)
+            zbuf2 = 0.5*(devk4(7)+devk5(7)*tc)
+            akw3(ji,jj,jk) = akw*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+C  Ksi
+C            aksi3(ji,jj,jk) = aksi
+C
+C  Or using coefficient of borates (cf millero 95+ corrected version html doc co2sys)
+C  "deltaVsi and deltaKsi have been estimated from the value of boric acid"
+C
+            zbuf1 = -(devk1(3)+devk2(3)*tc+devk3(3)*tc*tc)
+            zbuf2 = 0.5*(devk4(3)+devk5(3)*tc)
+            aksi3(ji,jj,jk) = aksi*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+C
+C
+C* 2.15 APPARENT SOLUBILITY PRODUCT K'SP OF CALCITE 
+C        AS FUNCTION OF PRESSURE FOLLOWING MILLERO
+C        (P. 1285) AND BERNER (1976)
+C -------------------------------------------------
+
+            zbuf1 = -(devk1(8)+devk2(8)*tc+devk3(8)*tc*tc)
+            zbuf2 = 0.5*(devk4(8)+devk5(8)*tc)
+            aksp(ji,jj,jk) = aksp1*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+C  Pressure correction for sulfate and fluoride
+C
+            zbuf1 = -(devk1(9)+devk2(9)*tc+devk3(9)*tc*tc)
+            zbuf2 = 0.5*(devk4(9)+devk5(9)*tc)
+            aks3(ji,jj,jk) = aks*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+            zbuf1 = -(devk1(10)+devk2(10)*tc+devk3(10)*tc*tc)
+            zbuf2 = 0.5*(devk4(10)+devk5(10)*tc)
+            akf3(ji,jj,jk) = akf*exp(zbuf1*cpexp+zbuf2*cpexp2)
+
+
+C
+C* 2.11 TOTAL BORATE CONCENTR. [MOLES/L]
+C --------------------------------------
+C
+            borat(ji,jj,jk) = bor1*cl*bor2
+C
+C  2.12 Iron and SIO3 saturation concentration from ...
+C  ----------------------------------------------------
+C
+         sio3eq(ji,jj,jk)=exp(log(10.)*(6.44-968./tkel))*1E-6
+         fekeq(ji,jj,jk)=10**(17.27-1565.7/(273.15+tc))
+C
+          ENDDO
+        ENDDO
+      END DO
+C
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zday.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zday.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zday.F	(revision 764)
@@ -0,0 +1,85 @@
+CCC$Header$
+CCC  TOP 1.0 , LOCEAN-IPSL (2005)
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zday
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zday : PISCES MODEL
+CCC          *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC        PISCES : compute the day length depending on latitude
+CCC                 and the day
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              ktask           : task identificator
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC            None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : E. Maier-Reimer (GBC 1993)
+CC      additions : C. Le Quere (1999)
+CC      modifications : O. Aumont (2004)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, iyy
+      REAL rum, delta, codel, phi, argu
+C
+C Get year
+C --------
+C
+      iyy = ndastp/10000
+
+       IF(lwp) write(numout,*)
+       IF(lwp) write(numout,*) 'p4zday - Julian day ', nday_year
+       IF(lwp) write(numout,*)
+
+
+      IF (nleapy.EQ.1 .AND. MOD(iyy,4).EQ.0) THEN
+          rum = FLOAT(nday_year-80)/366.
+      ELSE
+          rum = FLOAT(nday_year-80)/365.
+      ENDIF
+
+C
+      delta = SIN(rum*rpi*2.)*sin(rpi*23.5/180.)
+      codel = asin(delta)
+
+      DO jj = 1,jpj
+        DO ji = 1,jpi
+          phi = gphit(ji,jj)*rpi/180.
+          argu = tan(codel)*tan(phi)
+          strn(ji,jj) = 0.
+          argu=min(1.,argu)
+          argu=max(-1.,argu)
+          strn(ji,jj)=24.-2.*acos(argu)*180./rpi/15.
+          strn(ji,jj)=max(strn(ji,jj),0.)
+        END DO
+      END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zdiat.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zdiat.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zdiat.F	(revision 764)
@@ -0,0 +1,113 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zdiat
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC           ROUTINE p4zdiat : PISCES MODEL
+CCC           ******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the mortality terms for diatoms
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC           None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2002)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL zfact,zstep,compadi
+C
+C      Time step duration for biology
+C      ------------------------------
+C
+        zstep=rfact2/rjjss
+C
+C    Aggregation term for diatoms is increased in case of nutrient
+C    stress as observed in reality. The stressed cells become more
+C    sticky and coagulate to sink quickly out of the euphotic zone
+C     ------------------------------------------------------------
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compadi = max((trn(ji,jj,jk,jpdia)-1E-8),0.)
+        zfact=1./(trn(ji,jj,jk,jpdia)+rtrn)
+C
+C    Aggregation term for diatoms is increased in case of nutrient
+C    stress as observed in reality. The stressed cells become more
+C    sticky and coagulate to sink quickly out of the euphotic zone
+C     ------------------------------------------------------------
+C
+        respp2(ji,jj,jk) = 1E6*zstep
+     &    *(wchl+wchld*(1.-xlimdia(ji,jj,jk)))
+     &    *zdiss(ji,jj,jk)*compadi*trn(ji,jj,jk,jpdia)
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+                                                                               
+        respds(ji,jj,jk) = respp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpbsi)*zfact
+
+        respdf(ji,jj,jk) = respp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdfe)*zfact
+                                                                               
+        respdch(ji,jj,jk)=respp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdch)*zfact
+C
+C     Phytoplankton mortality. 
+C     ------------------------
+C
+        tortp2(ji,jj,jk) = mprat2*zstep*trn(ji,jj,jk,jpdia)
+     &    /(xkmort+trn(ji,jj,jk,jpdia))*compadi
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+
+        tortds(ji,jj,jk) = tortp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpbsi)*zfact
+
+        tortdf(ji,jj,jk)=tortp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdfe)*zfact
+
+        tortdch(ji,jj,jk)=tortp2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdch)*zfact
+C
+            END DO
+          END DO
+        END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zflx.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zflx.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zflx.F	(revision 764)
@@ -0,0 +1,192 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zflx
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zflx : PISCES MODEL
+CCC          *****************************
+CCC
+CCC
+CC     PURPOSE.
+CC     --------
+CC          *P4ZFLX* CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE
+CC
+CC     EXTERNALS.
+CC     ----------
+CC          NONE.
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original      : 1988-07 E. MAIER-REIMER      MPI HAMBURG
+CC      additions     : 1998    O. Aumont
+CC      modifications : 1999    C. Le Quere
+CC      modifications : 2004    O. Aumont
+CC     -----------------------------------------------------------------
+CC  parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER nspyr, ji, jj, krorr
+      REAL zpdtan
+      REAL kgco2(jpi,jpj),kgo2(jpi,jpj),h2co3(jpi,jpj)
+      REAL ttc, ws
+      REAL fld, flu, oxy16, flu16, zfact
+      REAL zph,ah2,zbot,zdic,zalk,schmitto2, zalka
+      REAL schmittco2
+C
+C
+C  1. ASSIGNATION TO EXPONENTS IN THE LISS AND MERLIVAT
+C     FORMULATION OF THE GAS EXCHANGE RATE
+c -----------------------------------------------------
+C
+      zpdtan = raass / rdt
+      nspyr  = nint(zpdtan)
+
+C
+C* 1.1 SURFACE CHEMISTRY (PCO2 AND [H+] IN
+C     SURFACE LAYER); THE RESULT OF THIS CALCULATION
+C     IS USED TO COMPUTE AIR-SEA FLUX OF CO2
+C ---------------------------------------------------
+C
+      DO krorr = 1,10
+C
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+C
+C* 1.2 DUMMY VARIABLES FOR DIC, H+, AND BORATE
+C --------------------------------------------
+C
+        zbot = borat(ji,jj,1)
+        zfact = rhop(ji,jj,1)/1000.+rtrn
+        zdic  = trn(ji,jj,1,jpdic)/zfact
+        zph = max(hi(ji,jj,1),1.E-10)/zfact
+        zalka = trn(ji,jj,1,jptal)/zfact
+C
+C* 1.3 CALCULATE [ALK]([CO3--], [HCO3-])
+C ------------------------------------
+C
+        zalk=zalka-
+     &        (akw3(ji,jj,1)/zph-zph+zbot/(1.+zph/akb3(ji,jj,1)))
+C
+C* 1.4 CALCULATE [H+] AND [H2CO3]
+C -----------------------------------------
+C
+         ah2=sqrt((zdic-zalk)**2+4*(zalk*ak23(ji,jj,1)
+     &     /ak13(ji,jj,1))*(2*zdic-zalk))
+        ah2=0.5*ak13(ji,jj,1)/zalk*((zdic-zalk)+ah2)
+        h2co3(ji,jj) = (2*zdic-zalk)/(2.+ak13(ji,jj,1)/ah2)*zfact
+        hi(ji,jj,1)  = ah2*zfact
+          END DO
+        END DO
+      END DO
+C
+C
+C 2. COMPUTE FLUXES
+C --------------
+C
+C 2.1 FIRST COMPUTE GAS EXCHANGE COEFFICIENTS
+C -------------------------------------------
+C
+      DO jj = 1,jpj
+        DO ji = 1,jpi
+C
+          ttc = min(35.,tn(ji,jj,1))
+          schmittco2=2073.1-125.62*ttc+3.6276*ttc**2
+     &      -0.043126*ttc**3
+          ws=vatm(ji,jj)
+C
+C 2.2 COMPUTE GAS EXCHANGE FOR CO2
+C --------------------------------
+C
+          kgco2(ji,jj) = (0.3*ws*ws + 2.5*(0.5246+ttc*(0.016256+
+     &      ttc*0.00049946)))*sqrt(660./schmittco2)
+C
+C 2.3 CONVERT TO m/s, and apply sea-ice cover
+C -----------------------------------------------------
+C
+          kgco2(ji,jj) = kgco2(ji,jj)/(100.*3600.)
+     &      *(1-freeze(ji,jj))*tmask(ji,jj,1)
+#    if defined key_off_degrad
+     &        *facvol(ji,jj,1)
+#    endif
+C
+         END DO
+       END DO
+C
+C 2.5 COMPUTE GAS EXCHANGE COEFFICIENT FO O2 FROM
+C      Waninkhof EQUATIONS
+C -----------------------------------------------
+C
+       DO jj = 1,jpj
+         DO ji = 1,jpi
+C
+          ws = vatm(ji,jj)
+          ttc = min(35.,tn(ji,jj,1))
+          schmitto2 = 1953.4-128.0*ttc+3.9918*ttc**2
+     &      -0.050091*ttc**3
+
+          kgo2(ji,jj) = (0.3*ws*ws + 2.5*(0.5246+ttc*(0.016256+
+     &      ttc*0.00049946)))*sqrt(660./schmitto2)
+
+C
+C CONVERT TO m/s AND APPLY SEA ICE COVER
+C -------------------------------------
+C
+          kgo2(ji,jj) = kgo2(ji,jj)/(100.*3600.)
+     &      *(1-freeze(ji,jj))*tmask(ji,jj,1)
+#    if defined key_off_degrad
+     &        *facvol(ji,jj,1)
+#    endif
+C
+         ENDDO
+       ENDDO
+C
+       DO jj = 1,jpj
+         DO ji = 1,jpi
+C
+C Compute CO2 flux for the sea and air
+C ------------------------------------
+C
+          fld = atcco2*tmask(ji,jj,1)*chemc(ji,jj,3)*kgco2(ji,jj)
+          flu = h2co3(ji,jj)*tmask(ji,jj,1)*kgco2(ji,jj)
+          tra(ji,jj,1,jpdic)= tra(ji,jj,1,jpdic)+(fld-flu)
+     &      /fse3t(ji,jj,1)
+C
+C Compute O2 flux 
+C ---------------
+C
+          oxy16 = trn(ji,jj,1,jpoxy)
+          flu16 = (atcox*chemc(ji,jj,2)-oxy16)*kgo2(ji,jj)
+          tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy)+flu16
+     &      /fse3t(ji,jj,1)
+C
+C Save diagnostics
+C ----------------
+C
+#    if defined key_trc_diaadd
+          trc2d(ji,jj,1) = (fld-flu)*1000.
+          trc2d(ji,jj,2) = flu16*1000.
+          trc2d(ji,jj,3) = kgco2(ji,jj)
+          trc2d(ji,jj,4) = atcco2-h2co3(ji,jj)/(chemc(ji,jj,3)+rtrn)
+#    endif
+C
+        END DO
+      END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zint.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zint.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zint.F	(revision 764)
@@ -0,0 +1,107 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zint(kt)
+#if defined key_passivetrc && defined key_trc_pisces
+CCC
+CCC
+CCC       ROUTINE p4zint : PISCES MODEL
+CCC       *****************************
+CCC
+CC
+CC   PURPOSE :
+CC   ---------
+CC           *P4ZINT* INTERPOLATION AND COMPUTATION OF 
+CC                    VARIOUS ACCESSORY FIELDS
+CC   INPUT :
+CC   -----
+CC      argument
+CC              kt              : time step
+CC
+CC   EXTERNAL :
+CC   ----------
+CC          NONE
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original      : 2004    O. Aumont
+CC ----------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC-----------------------------------------------------------------
+CC------
+CC local declarations
+CC ==================
+C
+      INTEGER kt
+      INTEGER ji, jj
+      INTEGER iman
+      INTEGER nspyr,nvit1t,nvit2t
+      REAL zpdtan, zman, zpdtmo, zdemi
+      REAL zt, zdum
+C
+C
+      zpdtan = raass / rdt
+      nspyr  = nint(zpdtan)
+      zman   = 12.
+      iman   = 12
+      zpdtmo = zpdtan / zman
+      zdemi  = zpdtmo / 2.
+      zt     = ( float ( kt) + zdemi) / zpdtmo
+      
+C  recherche de l'indice des enregistrements
+C  du modele dynamique encadrant le pas de temps kt.
+C  --------------------------------------------------
+C
+      xtvit = zt - float(int ( zt))
+      nvit1t = int (zt)
+      nvit2t = nvit1t+1
+      nvit1t = MOD ( nvit1t, iman)
+      IF ( nvit1t .EQ. 0 ) nvit1t = iman
+      nvit2t = MOD ( nvit2t, iman)
+      IF ( nvit2t .EQ. 0 ) nvit2t = iman
+C
+C Interpolation of dust deposition
+C --------------------------------
+C
+         dust(:,:) = (1.-xtvit)*dustmo(:,:,nvit1t)
+     $            +xtvit*dustmo(:,:,nvit2t)
+C
+C
+C Computation of phyto and zoo metabolic rate
+C -------------------------------------------
+C
+
+         Tgfunc(:,:,:) = exp(0.063913*tn(:,:,:))
+         Tgfunc2(:,:,:) = exp(0.07608*tn(:,:,:))
+C
+C      Computation of the silicon dependant half saturation
+C      constant for silica uptake
+C       ---------------------------------------------------
+C
+        DO ji=1,jpi
+          DO jj=1,jpj
+          zdum=trn(ji,jj,1,jpsil)**2
+          xksimax(ji,jj) = max(xksimax(ji,jj),(1.+7.*zdum
+     &      /(xksi2*xksi2*25.+zdum))*1E-6)
+          END DO
+        END DO
+C
+        IF (nday_year.EQ.365) THEN
+           xksi=xksimax
+           xksimax=0.
+        ENDIF
+C
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlim.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlim.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlim.F	(revision 764)
@@ -0,0 +1,143 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zlim
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC             ROUTINE p4zlim : PISCES MODEL
+CCC             *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the co-limitations by the various nutrients
+CCC         for the various phytoplankton species
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2004)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL xlim1,xlim2,xlim3,xlim4,zno3,zferlim
+      REAL xconctemp,xconctemp2,xconctempn,xconctempn2
+C
+C  Tuning of the iron concentration to a minimum
+C  level that is set to the detection limit
+C  -------------------------------------
+C
+        do jk=1,jpk
+          do jj=1,jpj
+            do ji=1,jpi
+        zno3=trn(ji,jj,jk,jpno3)*1E6
+        zferlim=max(1.5E-11*(zno3/40)**2,3E-12)
+        zferlim=min(zferlim,1.5E-11)
+        trn(ji,jj,jk,jpfer)=max(trn(ji,jj,jk,jpfer),zferlim)
+            end do
+          end do
+        end do
+C
+C  Computation of a variable Ks for iron on diatoms
+C  taking into account that increasing biomass is
+C  made of generally bigger cells
+C  ------------------------------------------------
+C
+        DO jk=1,jpkm1
+          DO jj=1,jpj
+            DO ji=1,jpi
+        xconctemp=max(0.,trn(ji,jj,jk,jpdia)-5E-7)
+        xconctemp2=min(5.E-7,trn(ji,jj,jk,jpdia))
+        xconctempn=max(0.,trn(ji,jj,jk,jpphy)-1E-6)
+        xconctempn2=min(1.E-6,trn(ji,jj,jk,jpphy))
+        concdfe(ji,jj,jk)=(xconctemp2*conc3+0.4E-9*
+     .    xconctemp)/(xconctemp2+xconctemp+rtrn)
+        concdfe(ji,jj,jk)=max(conc3,concdfe(ji,jj,jk))
+        concnfe(ji,jj,jk)=(xconctempn2*conc2+0.08E-9*
+     .    xconctempn)/(xconctempn2+xconctempn+rtrn)
+        concnfe(ji,jj,jk)=max(conc2,concnfe(ji,jj,jk))
+            END DO
+          END DO
+        END DO
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C    
+C      Michaelis-Menten Limitation term for nutrients
+C      Small flagellates
+C      -----------------------------------------------
+C
+        xnanono3(ji,jj,jk)=trn(ji,jj,jk,jpno3)*concnnh4
+     &      /(conc0*concnnh4+concnnh4*trn(ji,jj,jk,jpno3)+
+     &        conc0*trn(ji,jj,jk,jpnh4))
+        xnanonh4(ji,jj,jk)=trn(ji,jj,jk,jpnh4)*conc0
+     &      /(conc0*concnnh4+concnnh4*trn(ji,jj,jk,jpno3)+
+     &        conc0*trn(ji,jj,jk,jpnh4))
+        xlim1=xnanono3(ji,jj,jk)+xnanonh4(ji,jj,jk)
+        xlim2=trn(ji,jj,jk,jppo4)/(trn(ji,jj,jk,jppo4)+concnnh4)
+        xlim3=trn(ji,jj,jk,jpfer)/(trn(ji,jj,jk,jpfer)
+     &     +concnfe(ji,jj,jk))
+        xlimphy(ji,jj,jk)=min(xlim1,xlim2,xlim3)
+        xlim1=trn(ji,jj,jk,jpnh4)/(concnnh4+trn(ji,jj,jk,jpnh4))
+        xlim3=trn(ji,jj,jk,jpfer)/(trn(ji,jj,jk,jpfer)+conc2)
+        xlim4=trn(ji,jj,jk,jpdoc)/(trn(ji,jj,jk,jpdoc)+xkdoc2)
+        xlimbac(ji,jj,jk)=min(xlim1,xlim2,xlim3)*xlim4
+C
+            END DO
+          END DO
+        END DO
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C   Michaelis-Menten Limitation term for nutrients
+C   Diatoms
+C   ----------------------------------------------
+C
+        xdiatno3(ji,jj,jk)=trn(ji,jj,jk,jpno3)*concdnh4
+     &      /(conc1*concdnh4+concdnh4*trn(ji,jj,jk,jpno3)+
+     &        conc1*trn(ji,jj,jk,jpnh4))
+        xdiatnh4(ji,jj,jk)=trn(ji,jj,jk,jpnh4)*conc1
+     &      /(conc1*concdnh4+concdnh4*trn(ji,jj,jk,jpno3)+
+     &        conc1*trn(ji,jj,jk,jpnh4))
+
+        xlim1=xdiatno3(ji,jj,jk)+xdiatnh4(ji,jj,jk)
+        xlim2=trn(ji,jj,jk,jppo4)/(trn(ji,jj,jk,jppo4)+concdnh4)
+        xlim3=trn(ji,jj,jk,jpsil)/(trn(ji,jj,jk,jpsil)+xksi(ji,jj))
+        xlim4=trn(ji,jj,jk,jpfer)/(trn(ji,jj,jk,jpfer)
+     &      +concdfe(ji,jj,jk))
+        xlimdia(ji,jj,jk)=min(xlim1,xlim2,xlim3,xlim4)
+C
+            END DO
+          END DO
+        END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlys.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlys.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zlys.F	(revision 764)
@@ -0,0 +1,166 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+       SUBROUTINE p4zlys
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC        ROUTINE p4zlys : PISCES MODEL
+CCC        *****************************
+CCC
+CCC
+CCC     PURPOSE.
+CCC     --------
+CCC          *P4ZLYS*  CALCULATES DEGREE OF CACO3 SATURATION IN THE WATER
+CCC                    COLUMN, DISSOLUTION/PRECIPITATION OF CACO3 AND LOSS
+CCC                    OF CACO3 TO THE CACO3 SEDIMENT POOL.
+CC
+CC     EXTERNALS.
+CC     ----------
+CC          NONE.
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original      : 1988-07 E. MAIER-REIMER      MPI HAMBURG
+CC      additions     : 1998    O. Aumont
+CC      modifications : 1999    C. Le Quere
+CC      modifications : 2004    O. Aumont
+CC ---------------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER ji, jj, jk, jn
+      REAL zbot, zalk, zdic, zph, remco3, ah2
+      REAL dispot, zfact, zalka
+      REAL omegaca, excess, excess0
+      REAL co3(jpi,jpj,jpk)
+C
+C
+C* 1.1  BEGIN OF ITERATION
+C ------------------------
+C
+      DO jn = 1,5
+C
+C* 1.2  COMPUTE [CO3--] and [H+] CONCENTRATIONS
+C -------------------------------------------
+C
+      DO jk = 1,jpkm1
+        DO jj=1,jpj
+          DO ji = 1, jpi
+C
+C* 1.3  SET DUMMY VARIABLE FOR TOTAL BORATE
+C -----------------------------------------
+C
+        zbot = borat(ji,jj,jk)
+        zfact=rhop(ji,jj,jk)/1000.+rtrn
+C
+C* 1.4  SET DUMMY VARIABLE FOR [H+]
+C ---------------------------------
+C
+        zph = hi(ji,jj,jk)*tmask(ji,jj,jk)/zfact
+     &    +(1.-tmask(ji,jj,jk))*1.e-9
+C
+C* 1.5  SET DUMMY VARIABLE FOR [SUM(CO2)]GIVEN 
+C -------------------------------------------
+C
+        zdic=trn(ji,jj,jk,jpdic)/zfact
+        zalka=trn(ji,jj,jk,jptal)/zfact
+C
+C* 1.6 CALCULATE [ALK]([CO3--], [HCO3-])
+C ------------------------------------
+C
+        zalk=zalka-(akw3(ji,jj,jk)/zph-zph
+     &     +zbot/(1.+zph/akb3(ji,jj,jk)))
+C
+C* 2.10 CALCULATE [H+] and [CO3--]
+C -----------------------------------------
+C
+        ah2=sqrt((zdic-zalk)*(zdic-zalk)+
+     &     4.*(zalk*ak23(ji,jj,jk)/ak13(ji,jj,jk))
+     &     *(2*zdic-zalk))
+C
+        ah2=0.5*ak13(ji,jj,jk)/zalk*((zdic-zalk)+ah2)
+        co3(ji,jj,jk) = zalk/(2.+ah2/ak23(ji,jj,jk))*zfact
+
+        hi(ji,jj,jk)  = ah2*zfact
+C
+          ENDDO
+        ENDDO
+      END DO
+C
+      END DO 
+C
+C     ---------------------------------------------------------
+C*    2. CALCULATE DEGREE OF CACO3 SATURATION AND CORRESPONDING
+C        DISSOLOUTION AND PRECIPITATION OF CACO3 (BE AWARE OF
+C        MGCO3)
+C     ---------------------------------------------------------
+C
+      DO jk = 1,jpkm1
+        DO jj = 1,jpj
+          DO ji = 1, jpi
+C
+C* 2.1  DEVIATION OF [CO3--] FROM SATURATION VALUE
+C ------------------------------------------------
+C
+            omegaca = ( calcon * co3(ji,jj,jk) )/aksp(ji,jj,jk)
+
+C
+C* 2.2  SET DEGREE OF UNDER-/SUPERSATURATION
+C ------------------------------------------
+C
+            excess0 = max(0.,(1.-omegaca))
+            excess = excess0**nca
+
+C
+C* 2.3  AMOUNT CACO3 (12C) THAT RE-ENTERS SOLUTION
+C       (ACCORDING TO THIS FORMULATION ALSO SOME PARTICULATE
+C       CACO3 GETS DISSOLVED EVEN IN THE CASE OF OVERSATURATION)
+C --------------------------------------------------------------
+C
+            dispot = kdca * excess * trn(ji,jj,jk,jpcal)
+#    if defined key_off_degrad
+     &        *facvol(ji,jj,jk)
+#    endif
+
+C
+C* 2.4  CHANGE OF [CO3--] , [ALK], PARTICULATE [CACO3],
+C       AND [SUM(CO2)] DUE TO CACO3 DISSOLUTION/PRECIPITATION
+C -----------------------------------------------------------
+C
+            remco3=dispot/rmoss
+            co3(ji,jj,jk) = co3(ji,jj,jk)+
+     &        remco3*rfact
+            tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal)+
+     &        2.*remco3
+            tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal)-
+     &        remco3
+            tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic)+
+     &        remco3
+C
+          ENDDO
+        ENDDO
+      END DO
+
+#    if defined key_trc_dia3d
+         trc3d(:,:,:,1) = rhop(:,:,:)
+         trc3d(:,:,:,2) = co3(:,:,:)
+         trc3d(:,:,:,3) = aksp(:,:,:)/calcon
+#    endif
+
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmeso.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmeso.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmeso.F	(revision 764)
@@ -0,0 +1,228 @@
+
+CCC $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/p4zmeso.F,v 1.8 2007/10/12 09:32:52 opalod Exp $ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zmeso
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC            ROUTINE p4zmeso : PISCES MODEL
+CCC            ******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the sources/sinks for mesozooplankton
+CCC
+CC   METHOD :
+CC   -------
+CC      
+CC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC          None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2002)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL compadi,compaph,compapoc,compaz
+      REAL zfact,zstep,compam,zdenom,graze2
+C
+C
+C
+C     Time step duration for biology
+C     ------------------------------
+C
+        zstep=rfact2/rjjss
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compam=max((trn(ji,jj,jk,jpmes)-1.E-9),0.)
+        zfact=zstep*tgfunc(ji,jj,jk)*compam
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+C
+C     Respiration rates of both zooplankton
+C     -------------------------------------
+C
+        respz2(ji,jj,jk) = resrat2*zfact
+     &    *(1.+3.*nitrfac(ji,jj,jk))
+     &    *trn(ji,jj,jk,jpmes)/(xkmort+trn(ji,jj,jk,jpmes))
+C
+C     Zooplankton mortality. A square function has been selected with
+C     no real reason except that it seems to be more stable and may
+C     mimic predation.
+C     ---------------------------------------------------------------
+C
+        tortz2(ji,jj,jk) = mzrat2*1E6*zfact*trn(ji,jj,jk,jpmes)
+C
+            END DO
+          END DO
+        END DO
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compadi = max((trn(ji,jj,jk,jpdia)-1E-8),0.)
+        compaz = max((trn(ji,jj,jk,jpzoo)-1.E-8),0.)
+        compaph = max((trn(ji,jj,jk,jpphy)-2E-7),0.)
+        compapoc=max((trn(ji,jj,jk,jppoc)-1E-8),0.)
+C
+C     Microzooplankton grazing
+C     ------------------------
+C
+        zdenom=1./(xkgraz2+xprefc*trn(ji,jj,jk,jpdia)
+     &    +xprefz*trn(ji,jj,jk,jpzoo)
+     &    +xprefp*trn(ji,jj,jk,jpphy)
+     &    +xprefpoc*trn(ji,jj,jk,jppoc))
+
+        graze2 = grazrat2*zstep*Tgfunc2(ji,jj,jk)*zdenom
+     &    *trn(ji,jj,jk,jpmes)
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+
+        grazd(ji,jj,jk) = graze2*xprefc*compadi
+        grazz(ji,jj,jk) = graze2*xprefz*compaz
+        grazn(ji,jj,jk) = graze2*xprefp*compaph
+        grazpoc(ji,jj,jk) = graze2*xprefpoc*compapoc
+
+        graznf(ji,jj,jk) = grazn(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnfe)/(trn(ji,jj,jk,jpphy)+rtrn)
+
+        graznch(ji,jj,jk) = grazn(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnch)/(trn(ji,jj,jk,jpphy)+rtrn)
+
+        grazs(ji,jj,jk) = grazd(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn)
+
+        grazf(ji,jj,jk) = grazd(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+
+        grazdch(ji,jj,jk) = grazd(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdch)/(trn(ji,jj,jk,jpdia)+rtrn)
+
+        grazpof(ji,jj,jk) = grazpoc(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+C
+            END DO
+          END DO
+        END DO
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C    Mesozooplankton flux feeding on GOC
+C    ----------------------------------
+C
+#if ! defined key_trc_kriest
+        grazffe(ji,jj,jk) = 5E3*zstep*wsbio4(ji,jj,jk)
+     &    *tgfunc2(ji,jj,jk)*trn(ji,jj,jk,jpgoc)*trn(ji,jj,jk,jpmes)
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+
+        grazfff(ji,jj,jk) = grazffe(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpbfe)/(trn(ji,jj,jk,jpgoc)+rtrn)
+#else
+C KRIEST3
+        grazffe(ji,jj,jk) = 0.5*1.3E-2/5.5E-7*0.3*zstep*wsbio3(ji,jj,jk)
+     &    *tgfunc(ji,jj,jk)*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jpmes)
+     &    /(trn(ji,jj,jk,jppoc)*1E7+0.1)
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+
+
+C        grazffe(ji,jj,jk) = 5E3*zstep*wsbio3(ji,jj,jk)
+C     &    *tgfunc2(ji,jj,jk)*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jpmes)
+C#    if defined key_off_degrad
+C     &    *facvol(ji,jj,jk)
+C#    endif
+        grazfff(ji,jj,jk) = grazffe(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+#endif
+
+
+C
+            END DO
+          END DO
+        END DO
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C    Mesozooplankton efficiency
+C    --------------------------
+C
+        grarem2(ji,jj,jk)=(grazd(ji,jj,jk)+grazz(ji,jj,jk)
+     &    +grazn(ji,jj,jk)+grazpoc(ji,jj,jk)+grazffe(ji,jj,jk))
+     &    *(1.-epsher2-unass2)
+#if ! defined key_trc_kriest
+        grafer2(ji,jj,jk)=(grazf(ji,jj,jk)+graznf(ji,jj,jk)
+     &    +grazz(ji,jj,jk)*ferat3+grazpof(ji,jj,jk)
+     &    +grazfff(ji,jj,jk))*(1.-epsher2-unass2)
+     &    +epsher2*(grazd(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+     &    -ferat3),0.)+grazn(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpnfe)/(trn(ji,jj,jk,jpphy)+rtrn)
+     &    -ferat3),0.)+grazpoc(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+     &    -ferat3),0.)+grazffe(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpbfe)/(trn(ji,jj,jk,jpgoc)+rtrn)
+     &    -ferat3),0.))
+#else
+        grafer2(ji,jj,jk)=(grazf(ji,jj,jk)+graznf(ji,jj,jk)
+     &    +grazz(ji,jj,jk)*ferat3+grazpof(ji,jj,jk)
+     &    +grazfff(ji,jj,jk))*(1.-epsher2-unass2)
+     &    +epsher2*(grazd(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+     &    -ferat3),0.)+grazn(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpnfe)/(trn(ji,jj,jk,jpphy)+rtrn)
+     &    -ferat3),0.)+grazpoc(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+     &    -ferat3),0.)+grazffe(ji,jj,jk)*max(
+     &    (trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+     &    -ferat3),0.))
+#endif
+        grapoc2(ji,jj,jk)=(grazd(ji,jj,jk)+grazz(ji,jj,jk)
+     &    +grazn(ji,jj,jk)+grazpoc(ji,jj,jk)+grazffe(ji,jj,jk))*unass2
+
+            END DO
+          END DO
+        END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmicro.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmicro.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zmicro.F	(revision 764)
@@ -0,0 +1,169 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zmicro
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC           ROUTINE p4zmicro : PISCES MODEL
+CCC           *******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the sources/sinks for microzooplankton
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC              None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2004)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL compadi,compadi2,compaz,compaph,compapoc
+      REAL graze,zdenom,zdenom2
+      REAL zfact,zstep,zinano,zidiat,zipoc
+C
+C    Time step duration for biology
+C    ------------------------------
+C
+        zstep=rfact2/rjjss
+C
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compaz = max((trn(ji,jj,jk,jpzoo)-1.E-9),0.)
+        zfact=zstep*tgfunc(ji,jj,jk)*compaz
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+C
+C     Respiration rates of both zooplankton
+C     -------------------------------------
+C
+        respz(ji,jj,jk) = resrat*zfact
+     &    *(1.+3.*nitrfac(ji,jj,jk))
+     &    *trn(ji,jj,jk,jpzoo)/(xkmort+trn(ji,jj,jk,jpzoo))
+C
+C     Zooplankton mortality. A square function has been selected with
+C     no real reason except that it seems to be more stable and may
+C     mimic predation.
+C     ---------------------------------------------------------------
+C
+          tortz(ji,jj,jk) = mzrat*1E6*zfact*trn(ji,jj,jk,jpzoo)
+C
+            END DO
+          END DO
+        END DO
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compadi = max((trn(ji,jj,jk,jpdia)-1E-8),0.)
+        compadi2=min(compadi,5.E-7)
+        compaph = max((trn(ji,jj,jk,jpphy)-2E-7),0.)
+        compapoc=max((trn(ji,jj,jk,jppoc)-1E-8),0.)
+C
+C     Microzooplankton grazing
+C     ------------------------
+C
+          zdenom2 = 1./(zprefp*compaph
+     &      +zprefc*compapoc+zprefd*compadi2+rtrn)
+
+          graze = grazrat*zstep*tgfunc(ji,jj,jk)
+     &      *trn(ji,jj,jk,jpzoo)
+#    if defined key_off_degrad
+     &      *facvol(ji,jj,jk)
+#    endif
+
+          zinano=zprefp*compaph*zdenom2
+          zipoc=zprefc*compapoc*zdenom2
+          zidiat=zprefd*compadi2*zdenom2
+
+          zdenom = 1./(xkgraz+zinano*compaph
+     &      +zipoc*compapoc+zidiat*compadi2)
+
+          grazp(ji,jj,jk) = graze*zinano*compaph*zdenom
+          grazm(ji,jj,jk) = graze*zipoc*compapoc*zdenom
+          grazsd(ji,jj,jk) = graze*zidiat*compadi2*zdenom
+
+          grazpf(ji,jj,jk) = grazp(ji,jj,jk)*
+     &      trn(ji,jj,jk,jpnfe)/(trn(ji,jj,jk,jpphy)+rtrn)
+
+          grazpch(ji,jj,jk) = grazp(ji,jj,jk)*
+     &      trn(ji,jj,jk,jpnch)/(trn(ji,jj,jk,jpphy)+rtrn)
+
+          grazmf(ji,jj,jk) = grazm(ji,jj,jk)
+     &      *trn(ji,jj,jk,jpsfe)/(trn(ji,jj,jk,jppoc)+rtrn)
+
+          grazsf(ji,jj,jk) = grazsd(ji,jj,jk)
+     &      *trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+
+          grazss(ji,jj,jk) = grazsd(ji,jj,jk)
+     &      *trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn)
+
+          grazsch(ji,jj,jk) = grazsd(ji,jj,jk)
+     &      *trn(ji,jj,jk,jpdch)/(trn(ji,jj,jk,jpdia)+rtrn)
+C
+            END DO
+          END DO
+        END DO
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C    Various remineralization and excretion terms
+C    --------------------------------------------
+C
+          grarem(ji,jj,jk)=(grazp(ji,jj,jk)+grazm(ji,jj,jk)
+     &      +grazsd(ji,jj,jk))*(1.-epsher-unass)
+
+          grafer(ji,jj,jk)=(grazpf(ji,jj,jk)+grazsf(ji,jj,jk)
+     &      +grazmf(ji,jj,jk))*(1.-epsher-unass)
+     &      +(grazm(ji,jj,jk)*max((trn(ji,jj,jk,jpsfe)/
+     &      (trn(ji,jj,jk,jppoc)+rtrn)-ferat3),0.)
+     &      +grazp(ji,jj,jk)*max((trn(ji,jj,jk,jpnfe)/
+     &      (trn(ji,jj,jk,jpphy)+rtrn)-ferat3),0.)
+     &      +grazsd(ji,jj,jk)*max((trn(ji,jj,jk,jpdfe)/
+     &      (trn(ji,jj,jk,jpdia)+rtrn)-ferat3),0.))*epsher
+
+          grapoc(ji,jj,jk)=(grazp(ji,jj,jk)+grazm(ji,jj,jk)
+     &      +grazsd(ji,jj,jk))*unass
+C
+              END DO
+            END DO
+          END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4znano.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4znano.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4znano.F	(revision 764)
@@ -0,0 +1,102 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4znano
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4znano : PISCES MODEL
+CCC          ******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the mortality terms for nanophytoplankton
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC          None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2002)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL zfact,zstep,compaph
+C
+C      Time step duration for biology
+C      ------------------------------
+C
+        zstep=rfact2/rjjss
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+        compaph = max((trn(ji,jj,jk,jpphy)-1E-8),0.)
+        zfact=1./(trn(ji,jj,jk,jpphy)+rtrn)
+C
+C     Squared mortality of Phyto similar to a sedimentation term during
+C     blooms (Doney et al. 1996)
+C     -----------------------------------------------------------------
+C
+        respp(ji,jj,jk) = wchl*1e6*zstep*zdiss(ji,jj,jk)
+     &    *compaph*trn(ji,jj,jk,jpphy)
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+                                                                               
+        respnf(ji,jj,jk) = respp(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnfe)*zfact
+                                                                               
+        respnch(ji,jj,jk) = respp(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnch)*zfact
+C
+C     Phytoplankton mortality. This mortality loss is slightly
+C     increased when nutrients are limiting phytoplankton growth
+C     as observed for instance in case of iron limitation.
+C     ----------------------------------------------------------
+C
+        tortp(ji,jj,jk) = mprat*zstep*trn(ji,jj,jk,jpphy)
+     $    /(xkmort+trn(ji,jj,jk,jpphy))*compaph
+#    if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#    endif
+                                                                               
+        tortnf(ji,jj,jk)=tortp(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnfe)*zfact
+                                                                               
+        tortnch(ji,jj,jk)=tortp(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnch)*zfact
+C
+            END DO
+          END DO
+        END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zopt.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zopt.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zopt.F	(revision 764)
@@ -0,0 +1,240 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zopt
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC             ROUTINE p4zopt : PISCES MODEL
+CCC             *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the light availability in the water column
+CCC         depending on the depth and the chlorophyll concentration
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2004)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk, mrgb
+      REAL xchl,ekg(jpi,jpj,jpk),ekr(jpi,jpj,jpk),ekb(jpi,jpj,jpk)
+      REAL parlux,e1(jpi,jpj,jpk),e2(jpi,jpj,jpk),e3(jpi,jpj,jpk)
+      REAL zdepmoy(jpi,jpj),etmp(jpi,jpj)
+      REAL zrlight,zblight,zglight
+      REAL zrlight1,zblight1,zglight1
+      REAL e3lum(jpi,jpj,jpk),e4lum(jpi,jpj,jpk)
+      REAL e5lum(jpi,jpj,jpk),e6lum(jpi,jpj,jpk)
+C
+C     Initialisation of variables used to compute PAR
+C     -----------------------------------------------
+C
+        e1     = 0.
+        e2     = 0.
+        e3     = 0.
+        etot   = 0.
+        parlux = 0.43/3.
+
+        IF (ln_qsr_sms) THEN
+C
+C    IF activated, computation of the qsr for the dynamics
+C    -----------------------------------------------------
+C
+          e3lum=0.
+          e4lum=0.
+          e5lum=0.
+          e6lum=0.
+        ENDIF
+
+        DO jk=1,jpkm1
+          DO jj=1,jpj
+            DO ji=1,jpi
+C
+C     Separation in three light bands: red, green, blue
+C     -------------------------------------------------
+C
+        xchl=(trn(ji,jj,jk,jpnch)+trn(ji,jj,jk,jpdch)+rtrn)*1.E6
+        xchl=max(0.03,xchl)
+        xchl=min(10.,xchl)
+                                                                                
+        mrgb = int(41+20.*log10(xchl)+rtrn)
+                                                                                
+        ekb(ji,jj,jk)=xkrgb(1,mrgb)
+        ekg(ji,jj,jk)=xkrgb(2,mrgb)
+        ekr(ji,jj,jk)=xkrgb(3,mrgb)
+C
+            END DO
+          END DO
+        END DO
+C
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C     Separation in three light bands: red, green, blue
+C     -------------------------------------------------
+C
+        zblight=0.5*ekb(ji,jj,1)*fse3t(ji,jj,1)
+        zglight=0.5*ekg(ji,jj,1)*fse3t(ji,jj,1)
+        zrlight=0.5*ekr(ji,jj,1)*fse3t(ji,jj,1)
+C
+        e1(ji,jj,1) = parlux*qsr(ji,jj)*exp(-zblight)
+        e2(ji,jj,1) = parlux*qsr(ji,jj)*exp(-zglight)
+        e3(ji,jj,1) = parlux*qsr(ji,jj)*exp(-zrlight)
+C
+            END DO
+          END DO
+
+        DO jk = 2,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C     Separation in three light bands: red, green, blue
+C     -------------------------------------------------
+C
+        zblight=0.5*(ekb(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+     &    +ekb(ji,jj,jk)*fse3t(ji,jj,jk))
+        zglight=0.5*(ekg(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+     &    +ekg(ji,jj,jk)*fse3t(ji,jj,jk))
+        zrlight=0.5*(ekr(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+     &    +ekr(ji,jj,jk)*fse3t(ji,jj,jk))
+C
+        e1(ji,jj,jk) = e1(ji,jj,jk-1)*exp(-zblight)
+        e2(ji,jj,jk) = e2(ji,jj,jk-1)*exp(-zglight)
+        e3(ji,jj,jk) = e3(ji,jj,jk-1)*exp(-zrlight)
+C
+            END DO
+          END DO
+        END DO
+C
+        etot(:,:,:) = e1(:,:,:)+e2(:,:,:)+e3(:,:,:)
+
+        IF (ln_qsr_sms) THEN
+C
+C   In the following, the vertical attenuation of qsr for the 
+C   dynamics is computed
+C   ---------------------------------------------------------
+C
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C     Separation in three light bands: red, green, blue
+C     -------------------------------------------------
+C
+        zblight=0.5*ekb(ji,jj,1)*fse3t(ji,jj,1)
+        zglight=0.5*ekg(ji,jj,1)*fse3t(ji,jj,1)
+        zrlight=0.5*ekr(ji,jj,1)*fse3t(ji,jj,1)
+C
+        e3lum(ji,jj,1) = parlux*qsr(ji,jj)
+        e4lum(ji,jj,1) = parlux*qsr(ji,jj)
+        e5lum(ji,jj,1) = parlux*qsr(ji,jj)
+        e6lum(ji,jj,1) = (1.-3.*parlux)*qsr(ji,jj)
+C
+            END DO
+          END DO
+
+        DO jk = 2,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C     Separation in three light bands: red, green, blue
+C     -------------------------------------------------
+C
+        zblight1=ekb(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+        zglight1=ekg(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+        zrlight1=ekr(ji,jj,jk-1)*fse3t(ji,jj,jk-1)
+
+        e3lum(ji,jj,jk) = e3lum(ji,jj,jk-1)*exp(-zblight)
+        e4lum(ji,jj,jk) = e4lum(ji,jj,jk-1)*exp(-zglight)
+        e5lum(ji,jj,jk) = e5lum(ji,jj,jk-1)*exp(-zrlight)
+        e6lum(ji,jj,jk) = e6lum(ji,jj,jk-1)
+     &    *exp(-fse3t(ji,jj,jk-1)/xsi1)
+C
+            END DO
+          END DO
+        END DO
+
+        etot3(:,:,:)=e3lum(:,:,:)+e4lum(:,:,:)+e5lum(:,:,:)
+     &    +e6lum(:,:,:)
+
+        ENDIF
+C    
+C     Computation of the euphotic depth
+C     ---------------------------------
+C    
+        zmeu(:,:) = 300.
+
+        DO jk = 2,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+        IF (etot(ji,jj,jk).GE.0.0043*qsr(ji,jj)) THEN
+           zmeu(ji,jj) = fsdepw(ji,jj,jk+1)
+        ENDIF
+            END DO
+          END DO
+        END DO
+C
+        zmeu(:,:)=min(300.,zmeu(:,:))
+C
+C    Computation of the mean light over the mixed layer depth
+C    --------------------------------------------------------
+C
+        zdepmoy  = 0
+        etmp  = 0.
+        emoy  = 0.
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+         if (fsdepw(ji,jj,jk+1).le.hmld(ji,jj)) then
+       etmp(ji,jj) = etmp(ji,jj)+etot(ji,jj,jk)*fse3t(ji,jj,jk)
+       zdepmoy(ji,jj)=zdepmoy(ji,jj)+fse3t(ji,jj,jk)
+         endif
+            END DO
+          END DO
+        END DO
+
+        emoy(:,:,:) = etot(:,:,:)
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+        IF (fsdepw(ji,jj,jk+1).LE.hmld(ji,jj)) THEN
+          emoy(ji,jj,jk) = etmp(ji,jj)/(zdepmoy(ji,jj)+rtrn)
+        ENDIF
+            END DO
+          END DO
+        END DO
+
+#   if defined key_trc_diaadd
+        trc2d(:,:,11) = zmeu(:,:)
+#    endif
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprg.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprg.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprg.F	(revision 764)
@@ -0,0 +1,118 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+       SUBROUTINE p4zprg(kt)
+CCC---------------------------------------------------------------------
+CCC
+CCC           ROUTINE p4zprg : PISCES MODEL
+CCC           *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC     Call Biological sources and sinks subroutines
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              ktask           : task identificator
+CC              kt              : time step
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   WORKSPACE :
+CC   ---------
+CC
+CC   EXTERNAL :
+CC   --------
+CC      p4zche, p4zint, p4zlys, p4zbio, p4zsed, p4zflx
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. AUMONT (2004)
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE trp_trc
+      USE sms
+CC
+      USE oce_trc
+      USE lbclnk
+      USE lib_mpp
+CC
+      IMPLICIT NONE
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+
+      INTEGER kt
+#if defined key_passivetrc && defined key_trc_pisces
+      INTEGER jnt, jn
+
+C
+C this part is without macrotasking coding
+C
+C Call an intermediate routine that in turns, calls chemistry
+C and another routine on a daily basis
+C -----------------------------------------------------------
+C
+      CALL p4zslow(kt)
+
+C......................................................................
+C
+C Compute soft tissue production (POC)
+C ------------------------------------
+
+       do jnt=1,nrdttrc
+C
+         CALL p4zbio
+
+C
+C......................................................................
+C
+C Compute soft tissue remineralisation
+C ------------------------------------
+C
+         CALL p4zsed
+
+C
+          trb=trn
+        END DO
+C
+C......................................................................
+C
+C Compute CaCO3 saturation
+C ------------------------
+C
+      CALL p4zlys
+
+C
+C......................................................................
+C
+C Compute surface fluxes
+C ----------------------
+C
+      CALL p4zflx
+
+
+      DO jn=1 , jptra
+        CALL lbc_lnk(trn(:,:,:,jn), 'T', 1. )
+        CALL lbc_lnk(trb(:,:,:,jn), 'T', 1. )
+        CALL lbc_lnk(tra(:,:,:,jn), 'T', 1. )
+      END DO
+
+C
+C......................................................................
+C
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprod.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprod.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zprod.F	(revision 764)
@@ -0,0 +1,266 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zprod
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC           ROUTINE p4zprod : PISCES MODEL
+CCC           ******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute the phytoplankton production depending on
+CCC         light, temperature and nutrient availability
+CCC
+CC   INPUT :
+CC   -----
+CC      argument
+CC              None
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC             p4zday
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : O. Aumont (2004) 
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL silfac,pislopen(jpi,jpj,jpk),pislope2n(jpi,jpj,jpk)
+      REAL zmixnano(jpi,jpj),zmixdiat(jpi,jpj),zfact
+      REAL prdiachl,prbiochl,silim,ztn,zadap,zadap2
+      REAL ysopt(jpi,jpj,jpk),pislopead(jpi,jpj,jpk)
+      REAL prdia(jpi,jpj,jpk),prbio(jpi,jpj,jpk)
+      REAL etot2(jpi,jpj,jpk),pislopead2(jpi,jpj,jpk)
+      REAL xlim,silfac2,siborn,zprod
+      REAL zmxltst,zmxlday,xlim1
+C
+C     Computation of the optimal production
+C     -------------------------------------
+C
+C
+        prmax(:,:,:)=0.6/rjjss*tgfunc(:,:,:)
+#    if defined key_off_degrad
+     &  *facvol(:,:,:)
+#    endif
+C
+C     Computation of the day length
+C     -----------------------------
+C
+        call p4zday 
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C      Computation of the P-I slope for nanos and diatoms
+C      --------------------------------------------------
+C
+        ztn=max(0.,tn(ji,jj,jk)-15.)
+        zadap=1.+2.*ztn/(2.+ztn)
+        zadap2=1.
+
+        zfact=exp(-0.21*emoy(ji,jj,jk))
+
+        pislopead(ji,jj,jk)=pislope*(1.+zadap*zfact)
+        pislopead2(ji,jj,jk)=pislope2*(1.+zadap2*zfact)
+
+        pislopen(ji,jj,jk)=pislopead(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnch)/(rtrn+trn(ji,jj,jk,jpphy)*12.)
+     &    /(prmax(ji,jj,jk)*rjjss*xlimphy(ji,jj,jk)+rtrn)
+
+        pislope2n(ji,jj,jk)=pislopead2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdch)/(rtrn+trn(ji,jj,jk,jpdia)*12.)
+     &    /(prmax(ji,jj,jk)*rjjss*xlimdia(ji,jj,jk)+rtrn)
+C
+            END DO
+          END DO
+        END DO
+
+        DO  jk = 1,jpkm1
+          DO  jj = 1,jpj
+            DO  ji = 1,jpi
+C
+C     Computation of production function
+C     ----------------------------------
+C
+        prbio(ji,jj,jk) = prmax(ji,jj,jk)
+     &    *(1.-exp(-pislopen(ji,jj,jk)*etot(ji,jj,jk)))
+        prdia(ji,jj,jk) = prmax(ji,jj,jk)
+     &    *(1.-exp(-pislope2n(ji,jj,jk)*etot(ji,jj,jk)))
+
+            END DO
+          END DO
+        END DO
+
+        DO  jk = 1,jpkm1
+          DO  jj = 1,jpj
+            DO  ji = 1,jpi
+C
+C    Si/C of diatoms
+C    ------------------------
+C    Si/C increases with iron stress and silicate availability
+C    Si/C is arbitrariliy increased for very high Si concentrations
+C    to mimic the very high ratios observed in the Southern Ocean
+c    (silpot2)
+C
+C
+        xlim1=trn(ji,jj,jk,jpsil)/(trn(ji,jj,jk,jpsil)+xksi1)
+        xlim=xdiatno3(ji,jj,jk)+xdiatnh4(ji,jj,jk)
+C
+        silim=min(prdia(ji,jj,jk)/(rtrn+prmax(ji,jj,jk)),
+     &    trn(ji,jj,jk,jpfer)/(concdfe(ji,jj,jk)+trn(ji,jj,jk,jpfer)),
+     &    trn(ji,jj,jk,jppo4)/(concdnh4+trn(ji,jj,jk,jppo4)),
+     &    xlim)
+        silfac=5.4*exp(-4.23*silim)*max(0.,min(1.,2.2*(xlim1-0.5)))+1.
+        siborn=max(0.,(trn(ji,jj,jk,jpsil)-15.E-6))
+        silfac2=1.+3.*siborn/(siborn+xksi2)
+        silfac=min(6.4,silfac*silfac2)
+C
+        ysopt(ji,jj,jk)=grosip*trn(ji,jj,jk,jpsil)/(trn(ji,jj,jk,jpsil)
+     $    +xksi1)*silfac
+C
+            END DO
+          END DO
+        END DO
+C
+C    Computation of the limitation term due to
+C    A mixed layer deeper than the euphotic depth
+C    --------------------------------------------
+C
+        DO jj=1,jpj
+          DO ji=1,jpi
+         zmxltst=max(0.,hmld(ji,jj)-zmeu(ji,jj))
+         zmxlday=zmxltst**2/rjjss
+         zmixnano(ji,jj)=1.-zmxlday/(1.+zmxlday)
+         zmixdiat(ji,jj)=1.-zmxlday/(3.+zmxlday)
+          END DO
+        END DO
+                                                                                
+        DO  jk = 1,jpkm1
+          DO  jj = 1,jpj
+            DO  ji = 1,jpi
+         if (fsdepw(ji,jj,jk+1).le.hmld(ji,jj)) then
+C
+C     Mixed-layer effect on production
+C     --------------------------------
+C
+         prbio(ji,jj,jk)=prbio(ji,jj,jk)*zmixnano(ji,jj)
+         prdia(ji,jj,jk)=prdia(ji,jj,jk)*zmixdiat(ji,jj)
+         endif
+            END DO
+          END DO
+        END DO
+C
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C      Computation of the maximum light intensity
+C      ------------------------------------------
+C
+        etot2(ji,jj,jk)=etot(ji,jj,jk)*24./(strn(ji,jj)+rtrn)
+        IF (strn(ji,jj).lt.1.) etot2(ji,jj,jk)=etot(ji,jj,jk)
+C
+            END DO
+          END DO
+        END DO
+
+        DO jk = 1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+C
+C     Computation of the various production terms for nanophyto.
+C     ----------------------------------------------------------
+C
+        pislopen(ji,jj,jk)=pislopead(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpnch)/(rtrn+trn(ji,jj,jk,jpphy)*12.)
+     &    /(prmax(ji,jj,jk)*rjjss*max(0.1,xlimphy(ji,jj,jk))+rtrn)
+
+        prbiochl = prmax(ji,jj,jk)
+     &    *(1.-exp(-pislopen(ji,jj,jk)*etot2(ji,jj,jk)))
+
+        prorca(ji,jj,jk) = prbio(ji,jj,jk)
+     &    *xlimphy(ji,jj,jk)*trn(ji,jj,jk,jpphy)*rfact2
+
+        pronew(ji,jj,jk)=prorca(ji,jj,jk)*xnanono3(ji,jj,jk)
+     &    /(xnanono3(ji,jj,jk)+xnanonh4(ji,jj,jk)+rtrn)
+        proreg(ji,jj,jk)=prorca(ji,jj,jk)-pronew(ji,jj,jk)
+C
+        zprod=rjjss*prorca(ji,jj,jk)*prbiochl*trn(ji,jj,jk,jpphy)
+     &    *max(0.1,xlimphy(ji,jj,jk))
+
+        prorca5(ji,jj,jk) = (fecnm)**2*zprod/chlcnm
+     &    /(pislopead(ji,jj,jk)*etot2(ji,jj,jk)*trn(ji,jj,jk,jpnfe)
+     &    +rtrn)
+
+        prorca6(ji,jj,jk) = chlcnm*144.*zprod/(pislopead(ji,jj,jk)
+     &    *etot2(ji,jj,jk)*trn(ji,jj,jk,jpnch)+rtrn)
+
+            END DO
+          END DO
+        END DO
+
+        DO  jk = 1,jpkm1
+          DO  jj = 1,jpj
+            DO  ji = 1,jpi
+C
+C       Computation of the various production terms for diatoms
+C       -------------------------------------------------------
+C
+        pislope2n(ji,jj,jk)=pislopead2(ji,jj,jk)
+     &    *trn(ji,jj,jk,jpdch)/(rtrn+trn(ji,jj,jk,jpdia)*12.)
+     &    /(prmax(ji,jj,jk)*rjjss*max(0.1,xlimdia(ji,jj,jk))+rtrn)
+
+        prdiachl = prmax(ji,jj,jk)
+     &    *(1.-exp(-etot2(ji,jj,jk)*pislope2n(ji,jj,jk)))
+C
+        prorca2(ji,jj,jk) = prdia(ji,jj,jk)
+     &    *xlimdia(ji,jj,jk)*trn(ji,jj,jk,jpdia)*rfact2
+
+C
+        pronew2(ji,jj,jk)=prorca2(ji,jj,jk)*xdiatno3(ji,jj,jk)
+     &    /(xdiatno3(ji,jj,jk)+xdiatnh4(ji,jj,jk)+rtrn)
+        proreg2(ji,jj,jk)=prorca2(ji,jj,jk)-pronew2(ji,jj,jk)
+        prorca3(ji,jj,jk) = prorca2(ji,jj,jk)*ysopt(ji,jj,jk)
+C
+        zprod=rjjss*prorca2(ji,jj,jk)*prdiachl*trn(ji,jj,jk,jpdia)
+     &    *max(0.1,xlimdia(ji,jj,jk))
+
+C
+        prorca4(ji,jj,jk) = (fecdm)**2*zprod/chlcdm
+     &    /(pislopead2(ji,jj,jk)*etot2(ji,jj,jk)*trn(ji,jj,jk,jpdfe)
+     &    +rtrn)
+C
+        prorca7(ji,jj,jk) = chlcdm*144.*zprod/(pislopead2(ji,jj,jk)
+     &    *etot2(ji,jj,jk)*trn(ji,jj,jk,jpdch)+rtrn)
+C
+            END DO
+          END DO
+        END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zrem.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zrem.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zrem.F	(revision 764)
@@ -0,0 +1,279 @@
+
+CCC $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/p4zrem.F,v 1.8 2007/10/12 09:28:41 opalod Exp $ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zrem
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zrem : PISCES MODEL
+CCC          *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute remineralization/scavenging of organic compounds
+CCC
+CC   INPUT :
+CC   -----
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC            None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : 2004 - O. Aumont 
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk
+      REAL remip,remik,xlam1b
+      REAL xkeq,xfeequi,siremin
+      REAL zsatur,zsatur2,znusil,zdepbac(jpi,jpj,jpk)
+      REAL zlamfac,zstep,fesatur(jpi,jpj,jpk)
+      REAL ztempbac(jpi,jpj)
+C
+C      Time step duration for the biology
+C
+       zstep=rfact2/rjjss
+C
+C      Computation of the mean phytoplankton concentration as
+C      a crude estimate of the bacterial biomass
+C      --------------------------------------------------
+C
+        DO jk=1,jpkm1
+          DO jj = 1, jpj
+            DO ji = 1, jpi
+         IF (fsdept(ji,jj,jk).lt.120.) THEN
+         zdepbac(ji,jj,jk)=min(0.7*(trn(ji,jj,jk,jpzoo)
+     &     +2*trn(ji,jj,jk,jpmes)),4E-6)
+         ztempbac(ji,jj)=zdepbac(ji,jj,jk)
+         ELSE
+         zdepbac(ji,jj,jk)=min(1.,120./fsdept(ji,jj,jk))
+     &      *ztempbac(ji,jj)
+         ENDIF
+            END DO
+          END DO
+        END DO
+
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C    DENITRIFICATION FACTOR COMPUTED FROM O2 LEVELS
+C    ----------------------------------------------
+C
+          nitrfac(ji,jj,jk)=
+     &      max(0.,0.4*(6.E-6-trn(ji,jj,jk,jpoxy))/(oxymin+
+     &      trn(ji,jj,jk,jpoxy)))
+             END DO
+           END DO
+         END DO
+
+          nitrfac(:,:,:)=min(1.,nitrfac(:,:,:))
+
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C     DOC ammonification. Depends on depth, phytoplankton biomass
+C     and a limitation term which is supposed to be a parameterization
+C     of the bacterial activity. 
+C     ----------------------------------------------------------------
+C
+         remik = xremik*zstep/1E-6*xlimbac(ji,jj,jk)
+     &     *zdepbac(ji,jj,jk)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+         remik=max(remik,5.5E-4*zstep)
+C
+C     Ammonification in oxic waters with oxygen consumption
+C     -----------------------------------------------------
+C
+         olimi(ji,jj,jk)=min((trn(ji,jj,jk,jpoxy)-rtrn)/o2ut,
+     &     remik*(1.-nitrfac(ji,jj,jk))*trn(ji,jj,jk,jpdoc)) 
+C
+C     Ammonification in suboxic waters with denitrification
+C     -------------------------------------------------------
+C
+         denitr(ji,jj,jk)=min((trn(ji,jj,jk,jpno3)-rtrn)/rdenit,
+     &     remik*nitrfac(ji,jj,jk)*trn(ji,jj,jk,jpdoc))
+             END DO
+           END DO
+         END DO
+C
+         olimi(:,:,:)=max(0.,olimi(:,:,:))
+         denitr(:,:,:)=max(0.,denitr(:,:,:))
+C
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C    NH4 nitrification to NO3. Ceased for oxygen concentrations
+C    below 2 umol/L. Inhibited at strong light 
+C    ----------------------------------------------------------
+C
+         onitr(ji,jj,jk)=nitrif*zstep*trn(ji,jj,jk,jpnh4)/(1.
+     &     +emoy(ji,jj,jk))*(1.-nitrfac(ji,jj,jk))
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+             END DO
+           END DO
+         END DO
+
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C    Bacterial uptake of iron. No iron is available in DOC. So
+C    Bacteries are obliged to take up iron from the water. Some
+C    studies (especially at Papa) have shown this uptake to be
+C    significant
+C    ----------------------------------------------------------
+C
+         xbactfer(ji,jj,jk)=15E-6*rfact2*4.*0.4*prmax(ji,jj,jk)
+     &     *(xlimphy(ji,jj,jk)*zdepbac(ji,jj,jk))**2
+     &     /(xkgraz2+zdepbac(ji,jj,jk))
+     &     *(0.5+sign(0.5,trn(ji,jj,jk,jpfer)-2E-11))
+C
+             END DO
+           END DO
+         END DO
+C
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C    POC disaggregation by turbulence and bacterial activity. 
+C    -------------------------------------------------------------
+C
+         remip=xremip*zstep*tgfunc(ji,jj,jk)*(1.-0.5*nitrfac(ji,jj,jk))
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+C    POC disaggregation rate is reduced in anoxic zone as shown by
+C    sediment traps data. In oxic area, the exponent of the martin's
+C    law is around -0.87. In anoxic zone, it is around -0.35. This
+C    means a disaggregation constant about 0.5 the value in oxic zones
+C    -----------------------------------------------------------------
+C
+         orem(ji,jj,jk)=remip*trn(ji,jj,jk,jppoc)
+         ofer(ji,jj,jk)=remip*trn(ji,jj,jk,jpsfe)
+#if ! defined key_trc_kriest
+         orem2(ji,jj,jk)=remip*trn(ji,jj,jk,jpgoc)
+         ofer2(ji,jj,jk)=remip*trn(ji,jj,jk,jpbfe)
+#else
+         orem2(ji,jj,jk)=remip*trn(ji,jj,jk,jpnum)
+#endif
+C
+             END DO
+           END DO
+         END DO
+
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C     Remineralization rate of BSi depedant on T and saturation
+C     ---------------------------------------------------------
+C
+         zsatur=(sio3eq(ji,jj,jk)-trn(ji,jj,jk,jpsil))/
+     &     (sio3eq(ji,jj,jk)+rtrn)
+         zsatur=max(rtrn,zsatur)
+         zsatur2=zsatur*(1.+tn(ji,jj,jk)/400.)**4
+         znusil=0.225*(1.+tn(ji,jj,jk)/15.)*zsatur+0.775*zsatur2**9
+
+         siremin=xsirem*zstep*znusil
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+         osil(ji,jj,jk)=siremin*trn(ji,jj,jk,jpdsi)
+             END DO
+           END DO
+         END DO
+C
+         fesatur(:,:,:)=0.6E-9
+C
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+C     scavenging rate of iron. this scavenging rate depends on the
+C     load in particles on which they are adsorbed. The
+C     parameterization has been taken from studies on Th
+C     ------------------------------------------------------------
+C
+         xkeq=fekeq(ji,jj,jk)
+         xfeequi=(-(1.+fesatur(ji,jj,jk)*xkeq-xkeq*trn(ji,jj,jk,jpfer))+
+     &     sqrt((1.+fesatur(ji,jj,jk)*xkeq-xkeq*trn(ji,jj,jk,jpfer))**2
+     &     +4.*trn(ji,jj,jk,jpfer)*xkeq))/(2.*xkeq)
+
+#if ! defined key_trc_kriest
+         xlam1b=3E-5+xlam1*(trn(ji,jj,jk,jppoc)
+     &     +trn(ji,jj,jk,jpgoc)+trn(ji,jj,jk,jpcal)+
+     &      trn(ji,jj,jk,jpdsi))*1E6
+#else
+         xlam1b=3E-5+xlam1*(trn(ji,jj,jk,jppoc)
+     &     +trn(ji,jj,jk,jpcal)+trn(ji,jj,jk,jpdsi))*1E6
+#endif
+         xscave(ji,jj,jk)=xfeequi*xlam1b*zstep
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+C  Increased scavenging for very high iron concentrations
+C  found near the coasts due to increased lithogenic particles
+C  and let's say it unknown processes (precipitation, ...)
+C  -----------------------------------------------------------
+C
+         zlamfac=max(0.,(gphit(ji,jj)+55.)/30.)
+         zlamfac=min(1.,zlamfac)
+#if ! defined key_trc_kriest
+         xlam1b=(80.*(trn(ji,jj,jk,jpdoc)+35E-6)+698.
+     &    *trn(ji,jj,jk,jppoc)+1.05E4*trn(ji,jj,jk,jpgoc))
+     &    *zdiss(ji,jj,jk)+1E-4*(1.-zlamfac)+xlam1*max(0.,
+     &    (trn(ji,jj,jk,jpfer)*1E9-1.))
+#else
+         xlam1b=(80.*(trn(ji,jj,jk,jpdoc)+35E-6)+698.
+     &    *trn(ji,jj,jk,jppoc))
+     &    *zdiss(ji,jj,jk)+1E-4*(1.-zlamfac)+xlam1*max(0.,
+     &    (trn(ji,jj,jk,jpfer)*1E9-1.))
+#endif
+
+
+         xaggdfe(ji,jj,jk)=xlam1b*zstep*0.5*(trn(ji,jj,jk,jpfer)
+     &     -xfeequi)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+
+C
+             END DO
+           END DO
+         END DO
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsed.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsed.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsed.F	(revision 764)
@@ -0,0 +1,323 @@
+
+CCC $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/p4zsed.F,v 1.9 2007/10/12 09:35:04 opalod Exp $ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zsed
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zsed : PISCES MODEL
+CCC          *****************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute loss of organic matter in the sediments. This
+CCC         is by no way a sediment model. The loss is simply 
+CCC         computed to balance the inout from rivers and dust
+CCC
+CC   INPUT :
+CC   -----
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC             None
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : 2004 - O. Aumont 
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      USE lib_mpp
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER ji, jj, jk, ikt
+      REAL sumsedsi,sumsedpo4,sumsedcal
+      REAL xconctmp,denitot,nitrpottot,nitrpot(jpi,jpj,jpk)
+      REAL xlim,xconctmp2,zstep,zfact
+      REAL irondep(jpi,jpj,jpk),sidep(jpi,jpj)
+      REAL zvol
+CC
+C
+C     Time step duration for the biology
+C     ----------------------------------
+C
+        zstep=rfact2/rjjss
+C
+C
+C     Initialisation of variables used to compute deposition
+C     ------------------------------------------------------
+C
+      irondep     = 0.
+      sidep       = 0.
+C
+C     Iron and Si deposition at the surface
+C     -------------------------------------
+C
+       do jj=1,jpj
+         do ji=1,jpi
+         irondep(ji,jj,1)=(0.014*dust(ji,jj)/(55.85*rmoss)
+     &      +3E-10/raass)*rfact2/fse3t(ji,jj,1)
+         sidep(ji,jj)=8.8*0.075*dust(ji,jj)*rfact2
+     &      /(fse3t(ji,jj,1)*28.1*rmoss)
+         end do
+       end do
+C
+C     Iron solubilization of particles in the water column
+C     ----------------------------------------------------
+C
+      do jk=2,jpk-1
+        do jj=1,jpj
+          do ji=1,jpi
+          irondep(ji,jj,jk)=dust(ji,jj)/(10.*55.85*rmoss)*rfact2
+     &      *0.0001
+          end do
+        end do
+      end do
+C
+C    Add the external input of nutrients, carbon and alkalinity
+C    ----------------------------------------------------------
+C
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+          trn(ji,jj,1,jppo4) = trn(ji,jj,1,jppo4)
+     &      +rivinp(ji,jj)*rfact2
+          trn(ji,jj,1,jpno3) = trn(ji,jj,1,jpno3)
+     &      +(rivinp(ji,jj)+nitdep(ji,jj))*rfact2
+          trn(ji,jj,1,jpfer) = trn(ji,jj,1,jpfer)
+     &      +rivinp(ji,jj)*3E-5*rfact2
+          trn(ji,jj,1,jpsil) = trn(ji,jj,1,jpsil)
+     &      +sidep(ji,jj)+cotdep(ji,jj)*rfact2/6.
+          trn(ji,jj,1,jpdic) = trn(ji,jj,1,jpdic)
+     &      +rivinp(ji,jj)*rfact2*2.631
+          trn(ji,jj,1,jptal) = trn(ji,jj,1,jptal)
+     &      +(cotdep(ji,jj)-rno3*(rivinp(ji,jj)
+     &      +nitdep(ji,jj)))*rfact2
+          END DO
+        END DO
+C
+
+C
+C     Add the external input of iron which is 3D distributed
+C     (dust, river and sediment mobilization)
+C     ------------------------------------------------------
+C
+        DO jk=1,jpkm1
+          DO jj=1,jpj
+            DO ji=1,jpi
+          trn(ji,jj,jk,jpfer) = trn(ji,jj,jk,jpfer)
+     &      +irondep(ji,jj,jk)+ironsed(ji,jj,jk)*rfact2
+            END DO
+          END DO
+        END DO
+C
+C     Initialisation of variables used to compute Sinking Speed
+C     ---------------------------------------------------------
+C
+        sumsedsi = 0.
+        sumsedpo4 = 0.
+        sumsedcal = 0.
+C
+C    Loss of biogenic silicon, Caco3 organic carbon in the sediments. 
+C    First, the total loss is computed.
+C    The factor for calcite comes from the alkalinity effect
+C    -------------------------------------------------------------
+C
+        DO jj=1,jpj
+          DO ji=1,jpi
+            ikt=max(mbathy(ji,jj)-1,1)
+            zfact=e1t(ji,jj)*e2t(ji,jj)/rjjss*tmask_i(ji,jj)
+            sumsedsi=sumsedsi+zfact*trn(ji,jj,ikt,jpdsi)
+#if ! defined key_trc_kriest
+     &               *wsbio4(ji,jj,ikt) 
+#else
+     &               *wscal(ji,jj,ikt)
+#endif
+            sumsedcal=sumsedcal+trn(ji,jj,ikt,jpcal)*wscal(ji,jj,ikt)
+     &          *2.*zfact
+#if  defined key_trc_kriest
+            sumsedpo4=sumsedpo4+
+     &          (trn(ji,jj,ikt,jppoc)*wsbio3(ji,jj,ikt))*zfact
+#else
+            sumsedpo4=sumsedpo4+(trn(ji,jj,ikt,jpgoc)*wsbio4(ji,jj,ikt)
+     &    +trn(ji,jj,ikt,jppoc)*wsbio3(ji,jj,ikt))*zfact
+#endif
+          END DO
+        END DO
+
+         IF( lk_mpp ) THEN
+            CALL mpp_sum( sumsedsi )   ! sums over the global domain
+            CALL mpp_sum( sumsedcal )   ! sums over the global domain
+            CALL mpp_sum( sumsedpo4 )   ! sums over the global domain
+         ENDIF
+C
+C    Then this loss is scaled at each bottom grid cell for
+C    equilibrating the total budget of silica in the ocean.
+C    Thus, the amount of silica lost in the sediments equal
+C    the supply at the surface (dust+rivers)
+C    ------------------------------------------------------
+C
+        DO jj=1,jpj
+          DO ji=1,jpi
+            ikt=max(mbathy(ji,jj)-1,1)
+            xconctmp=trn(ji,jj,ikt,jpdsi)*zstep/fse3t(ji,jj,ikt)
+#if ! defined key_trc_kriest
+     &               *wsbio4(ji,jj,ikt) 
+#else
+     &               *wscal(ji,jj,ikt)
+#endif
+            trn(ji,jj,ikt,jpdsi)=trn(ji,jj,ikt,jpdsi)-xconctmp
+            trn(ji,jj,ikt,jpsil)=trn(ji,jj,ikt,jpsil)+xconctmp
+     &          *(1.-(sumdepsi+rivalkinput/raass/6.)/sumsedsi)
+          END DO
+        END DO
+
+        DO jj=1,jpj
+          DO ji=1,jpi
+            ikt=max(mbathy(ji,jj)-1,1)
+            xconctmp=trn(ji,jj,ikt,jpcal)*wscal(ji,jj,ikt)*zstep
+     &          /fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jpcal)=trn(ji,jj,ikt,jpcal)-xconctmp
+            trn(ji,jj,ikt,jptal)=trn(ji,jj,ikt,jptal)+xconctmp
+     &          *(1.-(rivalkinput/raass)/sumsedcal)*2.
+            trn(ji,jj,ikt,jpdic)=trn(ji,jj,ikt,jpdic)+xconctmp
+     &          *(1.-(rivalkinput/raass)/sumsedcal)
+          END DO
+        END DO
+
+        DO jj=1,jpj
+          DO ji=1,jpi
+            ikt=max(mbathy(ji,jj)-1,1)
+#if ! defined key_trc_kriest
+            xconctmp=trn(ji,jj,ikt,jpgoc)
+            xconctmp2=trn(ji,jj,ikt,jppoc)
+            trn(ji,jj,ikt,jpgoc)=trn(ji,jj,ikt,jpgoc)
+     &          -xconctmp*wsbio4(ji,jj,ikt)*zstep/fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jppoc)=trn(ji,jj,ikt,jppoc)
+     &          -xconctmp2*wsbio3(ji,jj,ikt)*zstep/fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jpdoc)=trn(ji,jj,ikt,jpdoc)
+     &          +(xconctmp*wsbio4(ji,jj,ikt)+xconctmp2*wsbio3(ji,jj,ikt)
+     $          )*zstep/fse3t(ji,jj,ikt)*(1.-rivpo4input/(raass
+     $          *sumsedpo4))
+            trn(ji,jj,ikt,jpbfe)=trn(ji,jj,ikt,jpbfe)
+     &          -trn(ji,jj,ikt,jpbfe)*wsbio4(ji,jj,ikt)*zstep
+     &          /fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jpsfe)=trn(ji,jj,ikt,jpsfe)
+     &          -trn(ji,jj,ikt,jpsfe)*wsbio3(ji,jj,ikt)*zstep
+     &          /fse3t(ji,jj,ikt)
+#else
+            xconctmp=trn(ji,jj,ikt,jpnum)
+            xconctmp2=trn(ji,jj,ikt,jppoc)
+            trn(ji,jj,ikt,jpnum)=trn(ji,jj,ikt,jpnum)
+     &          -xconctmp*wsbio4(ji,jj,ikt)*zstep/fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jppoc)=trn(ji,jj,ikt,jppoc)
+     &          -xconctmp2*wsbio3(ji,jj,ikt)*zstep/fse3t(ji,jj,ikt)
+            trn(ji,jj,ikt,jpdoc)=trn(ji,jj,ikt,jpdoc)
+     &          +(xconctmp2*wsbio3(ji,jj,ikt))
+     $          *zstep/fse3t(ji,jj,ikt)*(1.-rivpo4input/(raass
+     $          *sumsedpo4))
+            trn(ji,jj,ikt,jpsfe)=trn(ji,jj,ikt,jpsfe)
+     &          -trn(ji,jj,ikt,jpsfe)*wsbio3(ji,jj,ikt)*zstep
+     &          /fse3t(ji,jj,ikt)
+
+#endif
+          END DO
+        END DO
+C
+C  Nitrogen fixation (simple parameterization). The total gain
+C  from nitrogen fixation is scaled to balance the loss by 
+C  denitrification
+C  -------------------------------------------------------------
+C
+        denitot=0.
+        DO jk=1,jpk-1
+          DO jj=2,jpj-1
+            DO ji=2,jpi-1
+        denitot=denitot+denitr(ji,jj,jk)*rdenit*e1t(ji,jj)*e2t(ji,jj)
+     &    *fse3t(ji,jj,jk)*tmask(ji,jj,jk)*tmask_i(ji,jj)
+     &    *znegtr(ji,jj,jk)
+            END DO
+          END DO
+        END DO
+
+        IF( lk_mpp )   CALL mpp_sum( denitot )  ! sum over the global domain
+C
+C  Potential nitrogen fication dependant on temperature
+C  and iron
+C  ----------------------------------------------------
+C
+       DO jk=1,jpk
+        DO jj=1,jpj
+          DO ji=1,jpi
+        xlim=(1.-xnanono3(ji,jj,jk)-xnanonh4(ji,jj,jk))
+        if (xlim.le.0.2) xlim=0.01
+        nitrpot(ji,jj,jk)=max(0.,(0.6*tgfunc(ji,jj,jk)-2.15)/rjjss)
+#if defined key_off_degrad
+     &    *facvol(ji,jj,jk)
+#endif
+     &    *xlim*rfact2*trn(ji,jj,jk,jpfer)/(conc3
+     &    +trn(ji,jj,jk,jpfer))*(1.-exp(-etot(ji,jj,jk)/50.))
+          END DO
+        END DO 
+       END DO
+C
+      nitrpottot=0.
+      DO jk=1,jpkm1
+        DO jj=1,jpj
+          DO ji=1,jpi
+        nitrpottot=nitrpottot+nitrpot(ji,jj,jk)*e1t(ji,jj)
+     &    *e2t(ji,jj)*tmask(ji,jj,jk)*tmask_i(ji,jj)*fse3t(ji,jj,jk)
+          END DO
+        END DO
+      END DO
+
+        IF( lk_mpp )   CALL mpp_sum( nitrpottot )  ! sum over the global domain
+C
+C  Nitrogen change due to nitrogen fixation
+C  ----------------------------------------
+C
+       DO jk=1,jpk
+        DO jj=1,jpj
+          DO ji=1,jpi
+#if ! defined key_cfg_1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )
+        zfact=nitrpot(ji,jj,jk)*denitot/nitrpottot
+#else
+        zfact=nitrpot(ji,jj,jk)*1.E-7
+#endif
+        trn(ji,jj,jk,jpnh4)=trn(ji,jj,jk,jpnh4)+zfact
+        trn(ji,jj,jk,jpoxy)=trn(ji,jj,jk,jpoxy)+zfact*o2nit
+        trn(ji,jj,jk,jppo4)=trn(ji,jj,jk,jppo4)+30./46.*zfact
+          END DO
+        END DO
+       END DO
+C
+#    if defined key_trc_diaadd
+        DO jj = 1,jpj
+          DO ji = 1,jpi
+        trc2d(ji,jj,13) = nitrpot(ji,jj,1)*1E-7*fse3t(ji,jj,1)*1E3
+     &    /rfact2
+        trc2d(ji,jj,12) = irondep(ji,jj,1)*1e3*rfact2r
+     &    *fse3t(ji,jj,1)
+          END DO
+        END DO
+#    endif
+C
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.F	(revision 764)
@@ -0,0 +1,51 @@
+      SUBROUTINE p4zsink
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zsink : PISCES MODEL
+CCC          ******************************
+CCC
+CCC  PURPOSE :
+CCC  ---------
+CCC         Compute vertical flux of particulate matter due to
+CCC         gravitational sinking
+CCC
+CC   INPUT :
+CC   -----
+CC      common
+CC              all the common defined in opa
+CC
+CC
+CC   OUTPUT :                   : no
+CC   ------
+CC
+CC   EXTERNAL :
+CC   --------
+CC            p4zsink2
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      original  : 2004 - O. Aumont 
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+
+#if defined key_trc_kriest
+
+# include "p4zsink.kriest.h"
+
+#else
+
+# include "p4zsink.std.h"
+
+#endif
+
+#endif
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.kriest.h
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.kriest.h	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.kriest.h	(revision 764)
@@ -0,0 +1,211 @@
+CCCCCC PISCES MODEL: Kriest parameterization
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER jksed, ji, jj, jk
+      REAL xagg1,xagg2,xagg3,xagg4,xagg5,xaggsi,xaggsh
+      REAL znum(jpi,jpj,jpk)
+      REAL xnum,xeps,xfm,xgm,xsm
+      REAL xdiv,xdiv1,xdiv2,xdiv3,xdiv4,xdiv5
+      REAL zval1, zval2, zval3, zval4
+      REAL zstep
+#if defined key_trc_dia3d
+      REAL zrfact2
+#endif
+      REAL sinking(jpi,jpj,jpk),sinking2(jpi,jpj,jpk)
+      REAL sinkfer(jpi,jpj,jpk)
+      REAL sinkcal(jpi,jpj,jpk),sinksil(jpi,jpj,jpk)
+C
+C
+C    Time step duration for biology
+C    ------------------------------
+C
+       zstep=rfact2/rjjss
+       
+C
+C
+C     Initialisation of variables used to compute Sinking Speed
+C     ---------------------------------------------------------
+C
+       znum(:,:,:) = 0.
+       jksed = 10
+       zval1 = 1. + xkr_zeta
+       zval2 = 1. + xkr_zeta + xkr_eta
+       zval3 = 1. + xkr_eta
+C
+C     Computation of the vertical sinking speed : Kriest et Evans, 2000
+C     -----------------------------------------------------------------
+C    
+       do jk=1,jpk-1
+         do jj=1,jpj
+           do ji=1,jpi
+             IF (tmask(ji,jj,jk).NE.0) THEN
+                 xnum = trn(ji,jj,jk,jppoc) / (trn(ji,jj,jk,jpnum)+rtrn)
+     &                     / xkr_massp
+C -------------- To avoid sinking speed over 50 m/day -------
+                 xnum = min( xnumm(jk), xnum )
+                 xnum = max( 1.1, xnum )
+                 znum(ji,jj,jk) = xnum
+C------------------------------------------------------------
+                 xeps = ( zval1 * xnum - 1. )/ ( xnum - 1. )
+                 xfm  = xkr_frac**( 1. - xeps )
+                 xgm  = xkr_frac**( zval1 - xeps )
+                 xdiv = max(1E-4,abs(xeps-zval2))*sign(1.,(xeps-zval2))
+                 xdiv1=(xeps-zval3)
+                 wsbio3(ji,jj,jk)= xkr_wsbio_min * ( xeps-zval1 ) / xdiv
+     &                           - xkr_wsbio_max * xgm * xkr_eta / xdiv
+                 wsbio4(ji,jj,jk)= xkr_wsbio_min * ( xeps-1. ) / xdiv1
+     &                           - xkr_wsbio_max * xfm * xkr_eta / xdiv1
+                 IF( xnum == 1.1) THEN
+                     wsbio3(ji,jj,jk) = wsbio4(ji,jj,jk)
+                 ENDIF
+             ENDIF
+           end do
+         end do
+       end do
+C
+       wscal(:,:,:)=max(wsbio3(:,:,:),50.)
+C
+C
+C   INITIALIZE TO ZERO ALL THE SINKING ARRAYS
+C   -----------------------------------------
+C
+         sinking=0.
+         sinking2=0.
+         sinkcal=0.
+         sinkfer=0.
+         sinksil=0.
+C
+C   Compute the sedimentation term using p4zsink2 for all
+C   the sinking particles
+C   -----------------------------------------------------
+C
+         CALL p4zsink2(wsbio3,sinking,jppoc)
+         CALL p4zsink2(wsbio4,sinking2,jpnum)
+         CALL p4zsink2(wsbio3,sinkfer,jpsfe)
+         CALL p4zsink2(wscal,sinksil,jpdsi)
+         CALL p4zsink2(wscal,sinkcal,jpcal)
+
+C
+C  Exchange between organic matter compartments due to
+C  coagulation/disaggregation
+C  ---------------------------------------------------
+C
+         zval1 = 1. + xkr_zeta
+         zval2 = 1. + xkr_eta
+         zval3 = 3. + xkr_eta
+         zval4 = 4. + xkr_eta
+
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+               IF (tmask(ji,jj,jk).NE.0.) THEN
+C
+                   xnum=trn(ji,jj,jk,jppoc)/(trn(ji,jj,jk,jpnum)+rtrn)
+     &                         /xkr_massp
+C -------------- To avoid sinking speed over 50 m/day -------
+                   xnum=min(xnumm(jk),xnum)
+                   xnum=max(1.1,xnum)
+C------------------------------------------------------------
+                   xeps =(zval1*xnum-1.)/(xnum-1.)
+                   xdiv =max(1E-4,abs(xeps-zval3))*sign(1.,(xeps-zval3))
+                   xdiv1=max(1E-4,abs(xeps-4.))*sign(1.,(xeps-4.))
+                   xdiv2=(xeps-2.)
+                   xdiv3=(xeps-3.)
+                   xdiv4=(xeps-zval2)
+                   xdiv5=(2*xeps-zval4)
+                   xfm=xkr_frac**(1.-xeps)
+                   xsm=xkr_frac**xkr_eta
+C
+C    Part I : Coagulation dependant on turbulence
+C    ----------------------------------------------
+C
+                   xagg1=(0.163*trn(ji,jj,jk,jpnum)**2
+     &           *2.*( (xfm-1.)*(xfm*xkr_mass_max**3-xkr_mass_min**3)
+     &           *(xeps-1)/xdiv1 + 3.*(xfm*xkr_mass_max-xkr_mass_min)
+     &           *(xfm*xkr_mass_max**2-xkr_mass_min**2)
+     &           *(xeps-1.)**2/(xdiv2*xdiv3)))
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+
+C
+                   xagg2=(2*0.163*trn(ji,jj,jk,jpnum)**2*xfm*
+     &                   ((xkr_mass_max**3+3.*(xkr_mass_max**2
+     &                    *xkr_mass_min*(xeps-1.)/xdiv2
+     &                    +xkr_mass_max*xkr_mass_min**2*(xeps-1.)/xdiv3)
+     &                    +xkr_mass_min**3*(xeps-1)/xdiv1)
+     &                    -xfm*xkr_mass_max**3*(1.+3.*((xeps-1.)/
+     &                    (xeps-2.)+(xeps-1.)/xdiv3)+(xeps-1.)/xdiv1)))
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+C
+                   xagg3=(0.163*trn(ji,jj,jk,jpnum)**2*xfm**2*8.
+     &                 *xkr_mass_max**3)
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+C
+                   xaggsh=(xagg1+xagg2+xagg3)*rfact2*zdiss(ji,jj,jk)
+     &                 /1000.
+C
+C    Aggregation of small into large particles
+C    Part II : Differential settling
+C    ----------------------------------------------
+C
+                   xagg4=(2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2*
+     &                 xkr_wsbio_min*(xeps-1.)**2
+     &                 *(xkr_mass_min**2*((1.-xsm*xfm)/(xdiv3*xdiv4)
+     &                 -(1.-xfm)/(xdiv*(xeps-1.)))-
+     &                 ((xfm*xfm*xkr_mass_max**2*xsm-xkr_mass_min**2)
+     &                 *xkr_eta)/(xdiv*xdiv3*xdiv5)))
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+C
+                   xagg5=(2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2
+     &                 *(xeps-1.)*xfm*xkr_wsbio_min
+     &                 *(xsm*(xkr_mass_min**2-xfm*xkr_mass_max**2)
+     &                 /xdiv3-(xkr_mass_min**2-xfm*xsm*xkr_mass_max**2)
+     &                 /xdiv))
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+C
+                   xaggsi=(xagg4+xagg5)*zstep/10.
+C
+                   xagg(ji,jj,jk)=0.5 * xkr_stick*(xaggsh+xaggsi)
+C
+C     Aggregation of DOC to small particles
+C     --------------------------------------
+C
+                   xaggdoc(ji,jj,jk)=(0.4*trn(ji,jj,jk,jpdoc)
+     &                 +1018.*trn(ji,jj,jk,jppoc))*zstep
+     &                 *zdiss(ji,jj,jk)*trn(ji,jj,jk,jpdoc)
+#    if defined key_off_degrad
+     &                 *facvol(ji,jj,jk)
+#    endif
+C
+
+               ENDIF
+             END DO
+           END DO
+         END DO
+C
+#    if defined key_trc_dia3d
+         zrfact2 = 1.e3*rfact2r
+         trc2d(:,:,5) = sinking(:,:,jksed+1)*zrfact2
+         trc2d(:,:,6) = sinking2(:,:,jksed+1)*zrfact2
+         trc2d(:,:,7) = sinkfer(:,:,jksed+1)*zrfact2
+         trc2d(:,:,9) = sinksil(:,:,jksed+1)*zrfact2
+         trc2d(:,:,10) = sinkcal(:,:,jksed+1)*zrfact2
+         trc3d(:,:,:,12) = sinking(:,:,:)*zrfact2
+         trc3d(:,:,:,13) = sinking2(:,:,:)*zrfact2
+         trc3d(:,:,:,14) = sinksil(:,:,:)*zrfact2
+         trc3d(:,:,:,15) = sinkcal(:,:,:)*zrfact2
+         trc3d(:,:,:,16) = znum(:,:,:)
+         trc3d(:,:,:,17) = wsbio3(:,:,:)
+         trc3d(:,:,:,18) = wsbio4(:,:,:)
+#    endif
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.std.h
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.std.h	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink.std.h	(revision 764)
@@ -0,0 +1,143 @@
+
+CDIR$ LIST
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+      INTEGER jksed, ji, jj, jk
+      REAL xagg1,xagg2,xagg3,xagg4
+      REAL zfact,zstep,wsmax
+#if defined key_trc_dia3d
+      REAL zrfact2
+#endif
+      REAL sinking(jpi,jpj,jpk),sinking2(jpi,jpj,jpk)
+      REAL sinkfer(jpi,jpj,jpk),sinkfer2(jpi,jpj,jpk)
+      REAL sinkcal(jpi,jpj,jpk),sinksil(jpi,jpj,jpk)
+C
+C    Time step duration for biology
+C    ------------------------------
+C
+       zstep=rfact2/rjjss
+C
+C    Sinking speeds of detritus is increased with depth as shown
+C    by data and from the coagulation theory
+C    -----------------------------------------------------------
+C
+       jksed=10
+C
+       DO jk=1,jpk-1
+         DO jj=1,jpj
+           DO ji=1,jpi
+       zfact=max(0.,fsdepw(ji,jj,jk+1)-hmld(ji,jj))/4000.
+       wsbio4(ji,jj,jk)=wsbio2+(200.-wsbio2)*zfact
+             END DO
+           END DO
+         END DO
+C
+C      LIMIT THE VALUES OF THE SINKING SPEEDS 
+C      TO AVOID NUMERICAL INSTABILITIES
+C
+      wsbio3(:,:,:)=wsbio
+
+      Do jk=1,jpk-1
+        DO jj=1,jpj
+          DO ji=1,jpi
+       wsmax=0.8*fse3t(ji,jj,jk)/zstep
+       wsbio4(ji,jj,jk)=min(wsbio4(ji,jj,jk),wsmax)
+       wsbio3(ji,jj,jk)=min(wsbio3(ji,jj,jk),wsmax)
+          END DO
+        END DO
+       END DO
+
+      wscal(:,:,:)=wsbio4(:,:,:)
+C
+C
+C   INITIALIZE TO ZERO ALL THE SINKING ARRAYS
+C   -----------------------------------------
+C
+         sinking=0.
+         sinking2=0.
+         sinkcal=0.
+         sinkfer=0.
+         sinksil=0.
+         sinkfer2=0.
+C
+C   Compute the sedimentation term using p4zsink2 for all
+C   the sinking particles
+C   -----------------------------------------------------
+C
+         CALL p4zsink2(wsbio3,sinking,jppoc)
+         CALL p4zsink2(wsbio3,sinkfer,jpsfe)
+         CALL p4zsink2(wsbio4,sinking2,jpgoc)
+         CALL p4zsink2(wsbio4,sinkfer2,jpbfe)
+         CALL p4zsink2(wsbio4,sinksil,jpdsi)
+         CALL p4zsink2(wscal,sinkcal,jpcal)
+C
+C  Exchange between organic matter compartments due to
+C  coagulation/disaggregation
+C  ---------------------------------------------------
+C
+         DO jk = 1,jpkm1
+           DO jj = 1,jpj
+             DO ji = 1,jpi
+C
+        zfact=zstep*zdiss(ji,jj,jk)
+C
+C    Part I : Coagulation dependent on turbulence
+C    ----------------------------------------------
+C
+         xagg1=940.*zfact*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jppoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+
+         xagg2=1.054E4*zfact*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jpgoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+C    Aggregation of small into large particles
+C    Part II : Differential settling
+C    ----------------------------------------------
+C
+         xagg3=0.66*zstep*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jpgoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+
+         xagg4=0.*zstep*trn(ji,jj,jk,jppoc)*trn(ji,jj,jk,jppoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+         xagg(ji,jj,jk)=xagg1+xagg2+xagg3+xagg4
+         xaggfe(ji,jj,jk)=xagg(ji,jj,jk)*trn(ji,jj,jk,jpsfe)/
+     &     (trn(ji,jj,jk,jppoc)+rtrn)
+C
+C     Aggregation of DOC to small particles
+C     --------------------------------------
+C
+         xaggdoc(ji,jj,jk)=(80*trn(ji,jj,jk,jpdoc)+698.
+     &     *trn(ji,jj,jk,jppoc))*zfact*trn(ji,jj,jk,jpdoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+
+         xaggdoc2(ji,jj,jk)=1.05E4*zfact*trn(ji,jj,jk,jpgoc)
+     &     *trn(ji,jj,jk,jpdoc)
+#    if defined key_off_degrad
+     &     *facvol(ji,jj,jk)
+#    endif
+C
+             END DO
+           END DO
+         END DO
+
+#    if defined key_trc_dia3d
+         zrfact2 = 1.e3*rfact2r
+         trc2d(:,:,5) = sinking(:,:,jksed+1)*zrfact2
+         trc2d(:,:,6) = sinking2(:,:,jksed+1)*zrfact2
+         trc2d(:,:,7) = sinkfer(:,:,jksed+1)*zrfact2
+         trc2d(:,:,8) = sinkfer2(:,:,jksed+1)*zrfact2
+         trc2d(:,:,9) = sinksil(:,:,jksed+1)*zrfact2
+         trc2d(:,:,10) = sinkcal(:,:,jksed+1)*zrfact2
+#    endif
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink2.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink2.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zsink2.F	(revision 764)
@@ -0,0 +1,151 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+      SUBROUTINE p4zsink2(wstmp,sinktemp,jn)
+CDIR$ LIST
+#if defined key_passivetrc && defined key_trc_pisces
+!!!
+!!!       p4zsink2 : PISCES model
+!!!       ***********************
+!!!
+!!
+!!  PURPOSE :
+!!  ---------
+!!     Compute the sedimentation terms for the various sinking
+!!     particles. The scheme used to compute the trends is based
+!!     on MUSCL. 
+!!
+!!   METHOD :
+!!   -------
+!!      this ROUTINE compute not exactly the advection but the
+!!      transport term, i.e.  div(u*tra).
+!!
+!!
+!!   REFERENCES :                
+!!   ----------                  
+!!
+!!   References :
+!!      Estubier, A., and M. Levy, Notes Techn. Pole de Modelisation
+!!      IPSL, Sept. 2000 (http://www.lodyc.jussieu.fr/opa)
+!!
+!!
+!!   MODIFICATIONS:
+!!   --------------
+!!       original :  06-00 (A.Estublier)
+!!       modifications : 2004 (O. Aumont)
+!!       
+!!----------------------------------------------------------------------
+CC ----------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ NOLIST
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+#include "domzgr_substitute.h90"
+CDIR$ LIST
+CC-----------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER ji,jj,jk,jn
+      REAL ztraz(jpi,jpj,jpk),zakz(jpi,jpj,jpk)
+      REAL zkz(jpi,jpj,jpk)
+      REAL zigma,zew,zstep,zign
+      REAL wstmp(jpi,jpj,jpk),sinktemp(jpi,jpj,jpk)
+      REAL wstmp2(jpi,jpj,jpk)
+
+!!!---------------------------------------------------------------------
+!!!  OPA8, LODYC (01/00)
+!!!---------------------------------------------------------------------
+! 1. Initialization
+! --------------
+
+        zstep  = rfact2
+
+        ztraz  = 0
+        zkz    = 0
+        zakz   = 0.
+
+        do jk=1,jpk-1
+         wstmp2(:,:,jk+1)=-wstmp(:,:,jk)/rjjss*tmask(:,:,jk+1)
+#    if defined key_off_degrad
+     &      *facvol(:,:,jk)
+#    endif
+        end do
+ 
+        wstmp2(:,:,1)=0.
+!
+! 3. Vertical advective flux
+!-------------------------------
+! ... first guess of the slopes
+!   ... interior values
+!
+        DO jk=2,jpkm1
+              ztraz(:,:,jk) = (trn(:,:,jk-1,jn) - trn(:,:,jk,jn))
+     $                          *tmask(:,:,jk)
+        ENDDO
+!
+! slopes
+!
+        DO jk=2,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1, jpi
+            zign = 0.5*(sign(1.,ztraz(ji,jj,jk)*ztraz(ji,jj,jk+1))+1)
+            zakz(ji,jj,jk) = 0.5*(ztraz(ji,jj,jk)
+     $                          +ztraz(ji,jj,jk+1))*zign
+            ENDDO
+          ENDDO
+        ENDDO        
+!
+! Slopes limitation
+!
+        DO jk=2,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1,jpi
+              zakz(ji,jj,jk) = sign(1.,zakz(ji,jj,jk)) * 
+     $                        min(abs(zakz(ji,jj,jk)),
+     $                        2.*abs(ztraz(ji,jj,jk+1)),
+     $                        2.*abs(ztraz(ji,jj,jk)))
+            ENDDO
+          ENDDO
+        ENDDO        
+
+! vertical advective flux
+        DO jk=1,jpkm1
+          DO jj = 1,jpj      
+            DO ji = 1, jpi    
+              zigma = wstmp2(ji,jj,jk+1)*zstep/fse3w(ji,jj,jk+1)
+              zew   = wstmp2(ji,jj,jk+1)
+              sinktemp(ji,jj,jk+1) = -zew*(trn(ji,jj,jk,jn)
+     $           -0.5*(1+zigma)*zakz(ji,jj,jk))*zstep
+            ENDDO
+          ENDDO
+        ENDDO 
+!
+! Boundary conditions
+!
+         sinktemp(:,:,1)=0.
+         sinktemp(:,:,jpk)=0.
+C
+       DO jk=1,jpkm1
+          DO jj = 1,jpj
+            DO ji = 1, jpi
+!
+            trn(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
+     &        + (sinktemp(ji,jj,jk)-sinktemp(ji,jj,jk+1))
+     &        /fse3t(ji,jj,jk)
+!
+            ENDDO
+          ENDDO
+        ENDDO
+!
+        trb(:,:,:,jn)=trn(:,:,:,jn)
+!
+#endif
+C
+      RETURN
+      END
Index: /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zslow.F
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zslow.F	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zslow.F	(revision 764)
@@ -0,0 +1,63 @@
+
+CCC $Header$ 
+CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
+C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+C ---------------------------------------------------------------------------
+CDIR$ LIST
+      SUBROUTINE p4zslow(kt)
+#if defined key_passivetrc && defined key_trc_pisces
+CCC---------------------------------------------------------------------
+CCC
+CCC          ROUTINE p4zslow : PISCES MODEL
+CCC          *****************************
+CCC
+CCC     PURPOSE.
+CCC     --------
+CCC          *P4ZSLOW* CALL VARIOUS ROUTINES ON A DAILY BASIS
+CCC
+CCC
+CC     EXTERNALS.
+CC     ----------
+CC          p4zche, p4zint
+CC
+CC   MODIFICATIONS:
+CC   --------------
+CC      NEW : 2004 O. Aumont
+CC----------------------------------------------------------------------
+CC parameters and commons
+CC ======================
+CDIR$ nolist
+      USE oce_trc
+      USE trp_trc
+      USE sms
+      IMPLICIT NONE
+CDIR$ list
+CC----------------------------------------------------------------------
+CC local declarations
+CC ==================
+C
+      INTEGER iyy, imm, idd, kt
+C
+      iyy = ndastp/10000
+      imm = (ndastp - iyy*10000)/100
+      idd = (ndastp - iyy*10000 - imm*100)
+
+       IF (ndayflxtr /= idd) THEN
+           ndayflxtr = idd
+C
+C* 1. COMPUTATION OF THE CHEMICAL CONSTANTS
+C  ----------------------------------------
+C
+       CALL p4zche
+C
+C  2. COMPUTATION OF VARIOUS RATES FOR BIOGEOCHEMISTRY
+C  ---------------------------------------------------
+C
+       CALL p4zint(kt)
+C
+      ENDIF
+C      
+#endif
+C
+      RETURN
+      END
Index: anches/dev_001_GM/NEMO/TOP_SRC/agrif_top_interp.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/agrif_top_interp.F90	(revision 763)
+++ 	(revision )
@@ -1,16 +1,0 @@
-MODULE agrif_top_interp
-   !!======================================================================
-   !!                   ***  MODULE agrif_top_interp  ***
-   !! TOP :   Dummy module when AGRIF is not used
-   !!======================================================================
-
-   !!----------------------------------------------------------------------
-   !!   Dummy module                                               NO AGRIF
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
-   !! $Header$ 
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
-   !!----------------------------------------------------------------------
-
-   !!======================================================================
-END MODULE agrif_top_interp
Index: anches/dev_001_GM/NEMO/TOP_SRC/agrif_top_update.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/agrif_top_update.F90	(revision 763)
+++ 	(revision )
@@ -1,16 +1,0 @@
-MODULE agrif_top_update
-   !!======================================================================
-   !!                   ***  MODULE agrif_top_update  ***
-   !! TOP :   Dummy module when AGRIF is not used
-   !!======================================================================
-
-   !!----------------------------------------------------------------------
-   !!   Dummy module                                               NO AGRIF
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
-   !! $Header$ 
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
-   !!----------------------------------------------------------------------
-
-   !!======================================================================
-END MODULE agrif_top_update
Index: /branches/dev_001_GM/NEMO/TOP_SRC/par_sms.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/par_sms.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/par_sms.F90	(revision 764)
@@ -0,0 +1,45 @@
+MODULE par_sms
+   !!======================================================================
+   !!                         ***  MODULE par_sms  ***
+   !! TOP :   parameters of passive tracers
+   !!======================================================================
+   !! History :   1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+#if defined key_passivetrc
+   !!----------------------------------------------------------------------
+   !!   'key_passivetrc'                                    Passive tracers
+   !!----------------------------------------------------------------------
+   USE par_trc_trp
+
+   IMPLICIT NONE
+
+#if defined key_trc_lobster1
+   !!----------------------------------------------------------------------
+   !!   'key_trc_lobster1'                        LOBSTER1 biological model  
+   !!----------------------------------------------------------------------
+#  include "par_sms_lobster1.h90"
+
+#elif defined key_trc_pisces
+   !!----------------------------------------------------------------------
+   !!   'key_trc_pisces'                            PISCES biological model                  
+   !!----------------------------------------------------------------------
+#  include "par_sms_pisces.h90"
+
+#elif defined key_cfc
+   !!----------------------------------------------------------------------
+   !!   'key_cfc  '                                      CFC chemical model                  
+   !!----------------------------------------------------------------------
+#  include "par_sms_cfc.h90"
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Empty module :                                     No passive tracer
+   !!----------------------------------------------------------------------
+#endif
+
+   !!======================================================================
+END MODULE par_sms
Index: /branches/dev_001_GM/NEMO/TOP_SRC/sms.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/sms.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/sms.F90	(revision 764)
@@ -0,0 +1,51 @@
+MODULE sms
+   !!======================================================================
+   !!                        ***  sms  ***
+   !! passive tracers :   set the passive tracers variables
+   !!======================================================================
+   !! History :    -   !  2004-03  (C. Ethe)  Free form and module
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Header:$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+#if defined key_passivetrc
+   !!----------------------------------------------------------------------
+   !!   'key_passivetrc'                                    Passive tracers
+   !!----------------------------------------------------------------------
+   USE par_oce
+   USE par_trc
+   USE par_sms
+
+   IMPLICIT NONE
+   PUBLIC
+
+# if defined key_trc_lobster1
+   !!----------------------------------------------------------------------
+   !!   'key_trc_lobster1'                        LOBSTER1 biological model  
+   !!----------------------------------------------------------------------
+#  include "sms_lobster1.h90"
+
+# elif defined key_trc_pisces
+   !!----------------------------------------------------------------------
+   !!   'key_trc_pisces'                            PISCES biological model                  
+   !!----------------------------------------------------------------------
+#  include "sms_pisces.h90"
+
+# elif defined key_cfc
+   !!----------------------------------------------------------------------
+   !!   'key_cfc  '                                      CFC chemical model                  
+   !!----------------------------------------------------------------------
+#  include "sms_cfc.h90"
+
+# endif
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Empty module :                                     No passive tracer
+   !!----------------------------------------------------------------------
+#endif
+
+   !!======================================================================
+END MODULE sms
Index: /branches/dev_001_GM/NEMO/TOP_SRC/trp_trc.F90
===================================================================
--- /branches/dev_001_GM/NEMO/TOP_SRC/trp_trc.F90	(revision 764)
+++ /branches/dev_001_GM/NEMO/TOP_SRC/trp_trc.F90	(revision 764)
@@ -0,0 +1,47 @@
+MODULE trp_trc
+   !!======================================================================
+   !!                         ***  MODULE trp_trc  ***
+   !! TOP :   TOP parameters used in TRP
+   !!======================================================================
+   !! History :   1.0  !  2004-03 (C. Ethe) original code
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+#if defined key_passivetrc
+   !!----------------------------------------------------------------------
+   !!   'key_passivetrc'                                    Passive tracers
+   !!----------------------------------------------------------------------
+
+   !! passive tracers number
+   USE par_trc_trp , ONLY :   jptra    =>   jptra    !: number of passive tracers
+
+   !! passive tracers fields 
+   USE trc         , ONLY :   trai     =>   trai     !: initial total tracer
+   USE trc         , ONLY :   trb      =>   trb      !: tracer field (before)
+   USE trc         , ONLY :   tra      =>   tra      !: tracer field (now)
+   USE trc         , ONLY :   trn      =>   trn      !: tracer field (after)
+
+   !! time step
+   USE trc         , ONLY :   ndttrc   =>   ndttrc   !: frequency of step on passive tracers (NAMELIST)
+
+   !! non-centered advection scheme (smolarkiewicz)
+   USE trc         , ONLY :   rtrn     =>   rtrn     !: value for truncation (NAMELIST)
+   USE trc         , ONLY :   ctrcnm   =>   ctrcnm   !: value for truncation (NAMELIST)
+
+# if defined key_trc_diaadd
+   USE par_trc_trp , ONLY :   jpdia2d  =>  jpdia2d   !: number of 2D passive tracers diag
+   USE par_trc_trp , ONLY :   jpdia3d  =>  jpdia3d   !: number of 3D passive tracers diag
+   USE trc         , ONLY :   trc2d    =>   trc2d    !: additional 2D variable for ouputs
+   USE trc         , ONLY :   trc3d    =>   trc3d    !: additional 3D variable for ouputs
+# endif
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Empty module :                                     No passive tracer
+   !!----------------------------------------------------------------------
+#endif
+
+   !!======================================================================
+END MODULE trp_trc
