Index: trunk/NEMO/TOP_SRC/PISCES/p4zbio.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 1073)
@@ -16,5 +16,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
    USE p4zsink         ! 
    USE p4zopt          ! 
@@ -30,5 +30,5 @@
    PRIVATE
 
-   PUBLIC   p4z_bio    ! called in p4zprg.F90
+   PUBLIC  p4z_bio    
 
    !! * Shared module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zche.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 1073)
@@ -19,10 +19,10 @@
    USE oce_trc         !
    USE trp_trc         !
-   USE sms             ! 
+   USE sms_pisces      ! 
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   p4z_che    ! called in p4zprg.F90
+   PUBLIC   p4z_che  
 
    !! * Shared module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zflx.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 1073)
@@ -20,5 +20,5 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
    USE prtctl_trc
    USE p4zche
@@ -27,5 +27,5 @@
    PRIVATE
 
-   PUBLIC   p4z_flx    ! called in p4zprg.F90
+   PUBLIC   p4z_flx  
 
    REAL(wp) :: &  ! pre-industrial atmospheric [co2] (ppm) 	
Index: trunk/NEMO/TOP_SRC/PISCES/p4zint.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 1073)
@@ -15,10 +15,10 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   p4z_int    ! called in p4zprg.F90
+   PUBLIC   p4z_int  
 
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &   !:
Index: trunk/NEMO/TOP_SRC/PISCES/p4zlim.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zlim.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zlim.F90	(revision 1073)
@@ -17,24 +17,25 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   p4z_lim    ! called in p4zprg.F90
+   PUBLIC p4z_lim    
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   conc0  = 2.e-6_wp         ,  &  !:
-     &                   conc1  = 10.e-6_wp        ,  &  !:
-     &                   conc2  = 2.e-11_wp        ,  &  !:
-     &                   conc2m = 8.E-11_wp        ,  &  !:
-     &                   conc3  = 1.e-10_wp        ,  &  !:
-     &                   conc3m = 4.e-10_wp        ,  &  !:
-     &                   concnnh4  = 1.e-7_wp      ,  &  !:
-     &                   concdnh4  = 5.e-7_wp      ,  &   !:
-     &                   xksi1     = 2.E-6_wp      ,  &   !:
-     &                   xksi2     = 3.33E-6_wp    ,  &   !:
-     &                   xkdoc     = 417.E-6_wp    ,  &   !:
-     &                   caco3r    = 0.3_wp               !:
+   REAL(wp), PUBLIC ::   &
+     conc0     = 2.e-6_wp      ,  &  !:
+     conc1     = 10.e-6_wp     ,  &  !:
+     conc2     = 2.e-11_wp     ,  &  !:
+     conc2m    = 8.E-11_wp     ,  &  !:
+     conc3     = 1.e-10_wp     ,  &  !:
+     conc3m    = 4.e-10_wp     ,  &  !:
+     concnnh4  = 1.e-7_wp      ,  &  !:
+     concdnh4  = 5.e-7_wp      ,  &  !:
+     xksi1     = 2.E-6_wp      ,  &  !:
+     xksi2     = 3.33E-6_wp    ,  &  !:
+     xkdoc     = 417.E-6_wp    ,  &  !:
+     caco3r    = 0.3_wp              !:
 
 
Index: trunk/NEMO/TOP_SRC/PISCES/p4zlys.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 1073)
@@ -20,5 +20,5 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
    USE prtctl_trc
 
@@ -29,6 +29,7 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   kdca    = 0.327e3_wp   ,  &  !:
-     &                   nca  = 1.0_wp                !:
+   REAL(wp), PUBLIC ::   &
+     kdca = 0.327e3_wp   ,  &  !:
+     nca  = 1.0_wp             !:
 
    !! * Module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zmeso.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zmeso.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zmeso.F90	(revision 1073)
@@ -17,5 +17,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
    USE prtctl_trc
    USE p4zint
@@ -29,15 +29,15 @@
    !! * Shared module variables
    REAL(wp), PUBLIC ::   &
-      xprefc = 1.0_wp       ,  &  !: 
-      xprefp = 0.2_wp       ,  &  !:
-      xprefz = 1.0_wp       ,  &  !:
+      xprefc   = 1.0_wp     ,  &  !: 
+      xprefp   = 0.2_wp     ,  &  !:
+      xprefz   = 1.0_wp     ,  &  !:
       xprefpoc = 0.0_wp     ,  &  !:
-      resrat2 = 0.005_wp    ,  &  !:
-      mzrat2 = 0.03_wp      ,  &  !:
+      resrat2  = 0.005_wp   ,  &  !:
+      mzrat2   = 0.03_wp    ,  &  !:
       grazrat2 = 0.7_wp     ,  &  !:
-      xkgraz2 = 20E-6_wp    ,  &  !:
-      unass2  = 0.3_wp      ,  & !:
-      sigma2 = 0.6_wp       ,  & !:
-      epsher2 = 0.33_wp     ,  & !:   
+      xkgraz2  = 20E-6_wp   ,  &  !:
+      unass2   = 0.3_wp     ,  &  !:
+      sigma2   = 0.6_wp     ,  &  !:
+      epsher2  = 0.33_wp    ,  &  !:   
       grazflux = 5.E3_wp 
 
Index: trunk/NEMO/TOP_SRC/PISCES/p4zmicro.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zmicro.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zmicro.F90	(revision 1073)
@@ -17,5 +17,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
    USE prtctl_trc
    USE p4zint
@@ -32,11 +32,11 @@
       xpref2p = 0.5_wp       ,  &  !:
       xpref2d = 0.5_wp       ,  &  !:
-      resrat = 0.03_wp      ,  &  !:
-      mzrat = 0.0_wp        ,  &  !:
-      grazrat = 4.0_wp      ,  &  !:
-      xkgraz = 20E-6_wp     ,  &  !:
-      unass  = 0.3_wp       ,  &  !:
-      sigma1 = 0.6_wp       ,  &  !:
-      epsher = 0.33_wp
+      resrat  = 0.03_wp      ,  &  !:
+      mzrat   = 0.0_wp       ,  &  !:
+      grazrat = 4.0_wp       ,  &  !:
+      xkgraz  = 20E-6_wp     ,  &  !:
+      unass   = 0.3_wp       ,  &  !:
+      sigma1  = 0.6_wp       ,  &  !:
+      epsher  = 0.33_wp
 
 
Index: trunk/NEMO/TOP_SRC/PISCES/p4zmort.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zmort.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zmort.F90	(revision 1073)
@@ -17,5 +17,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
    USE p4zsink
    USE prtctl_trc
@@ -24,13 +24,14 @@
    PRIVATE
 
-   PUBLIC   p4z_mort         ! called in p4zbio.F90
+   PUBLIC   p4z_mort    
 
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   wchl = 0.001_wp      ,  &  !:
-     &                   wchld = 0.02_wp      ,  &  !:
-     &                   mprat = 0.01_wp      ,  &  !:
-     &                   mprat2 = 0.01_wp     ,  &  !:
-     &                   mpratm = 0.01_wp           !:
+   REAL(wp), PUBLIC ::   &
+     wchl   = 0.001_wp    ,  &  !:
+     wchld  = 0.02_wp     ,  &  !:
+     mprat  = 0.01_wp     ,  &  !:
+     mprat2 = 0.01_wp     ,  &  !:
+     mpratm = 0.01_wp           !:
 
    !! * Module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zopt.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 1073)
@@ -16,10 +16,10 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   p4z_opt   ! called in p4zprg.F90
+   PUBLIC   p4z_opt  
 
    !! * Shared module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zprod.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 1073)
@@ -16,6 +16,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
-   USE p4zday          !
+   USE sms_pisces      ! 
    USE prtctl_trc
    USE p4zint
@@ -29,13 +28,14 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   pislope   = 3.0_wp          ,  &  !:
-     &                   pislope2  = 3.0_wp          ,  &  !:
-     &                   excret  = 10.e-5_wp         , &   !:
-     &                   excret2 = 0.05_wp           , &   !:
-     &                   chlcnm  = 0.033_wp          , &   !:
-     &                   chlcdm  = 0.05_wp           , &   !:
-     &                   fecnm  = 10.E-6_wp          , &   !:
-     &                   fecdm  = 15.E-6_wp          , &   !:
-     &                   grosip = 0.151_wp
+   REAL(wp), PUBLIC ::   &
+     pislope   = 3.0_wp          ,  &  !:
+     pislope2  = 3.0_wp          ,  &  !:
+     excret    = 10.e-5_wp       , &   !:
+     excret2   = 0.05_wp         , &   !:
+     chlcnm    = 0.033_wp        , &   !:
+     chlcdm    = 0.05_wp         , &   !:
+     fecnm     = 10.E-6_wp       , &   !:
+     fecdm     = 15.E-6_wp       , &   !:
+     grosip    = 0.151_wp
 
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)  ::        &
@@ -43,5 +43,8 @@
    
    REAL(wp) ::   &
-     tpp = 0.                               !: Total primary production
+      texcret                    ,  &  !: 1 - excret 
+      texcret2                   ,  &  !: 1 - excret2        
+      rpis180                    ,  &  !: rpi / 180
+      tpp = 0.                         !: Total primary production
 
    !!* Substitution
@@ -69,6 +72,7 @@
       REAL(wp) ::   zprdiachl, zprbiochl, zsilim, ztn, zadap, zadap2
       REAL(wp) ::   zlim, zsilfac2, zsiborn, zprod, zetot2, zmax, zproreg, zproreg2
-      REAL(wp) ::   zmxltst, zmxlday, zlim1, zexcret, zexcret2
+      REAL(wp) ::   zmxltst, zmxlday, zlim1
       REAL(wp) ::   zpislopen  , zpislope2n
+      REAL(wp) ::   zrum, zcodel, zargu
       REAL(wp), DIMENSION(jpi,jpj)     ::   zmixnano   , zmixdiat, zstrn
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpislopead , zpislopead2
@@ -98,6 +102,4 @@
       nspyr  = INT( raass / rdt )
 
-      zexcret  = 1. - excret
-      zexcret2 = 1. - excret2
 
 !     Computation of the optimal production
@@ -110,5 +112,27 @@
 # endif
 
-      CALL p4z_day       ! Computation of the day length
+      ! compute the day length depending on latitude and the day
+      !--------------------------------------------------------
+      IF(lwp) write(numout,*)
+      IF(lwp) write(numout,*) 'p4zday : - Julian day ', nday_year
+      IF(lwp) write(numout,*) '~~~~~~'
+
+      IF( nleapy == 1 .AND. MOD( nyear, 4 ) == 0 ) THEN
+         zrum = FLOAT( nday_year - 80 ) / 366.
+      ELSE
+         zrum = FLOAT( nday_year - 80 ) / 365.
+      ENDIF
+      zcodel = ASIN(  SIN( zrum * rpi * 2. ) * SIN( rpis180 * 23.5 )  )
+
+      ! day length in hours
+      zstrn(:,:) = 0.
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zargu = TAN( zcodel ) * TAN( gphit(ji,jj) * rpis180 )
+            zargu = MAX( -1., MIN(  1., zargu ) )
+            zstrn(ji,jj) = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rpis180 / 15. )
+         END DO
+      END DO
+
 
 !CDIR NOVERRCHK
@@ -210,15 +234,17 @@
 !     Computation of the fractionnal day length
 !     -----------------------------------------
-      zstrn(:,:) = strn(:,:)
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-
+!      zstrn(:,:) = strn(:,:)
+
+      WHERE( zstrn(:,:) < 1.e0 ) zstrn(:,:) = 24.
+      zstrn(:,:) = 24. / zstrn(:,:)
+!      DO jj = 1, jpj
+!         DO ji = 1, jpi
+!
 !      Computation of the maximum light intensity
 !      ------------------------------------------
-            IF( zstrn(ji,jj) < 1.e0 )   zstrn(ji,jj) = 24.
-            zstrn(ji,jj) = 24./zstrn(ji,jj)
-         END DO
-      END DO
+!            IF( zstrn(ji,jj) < 1.e0 )   zstrn(ji,jj) = 24.
+!            zstrn(ji,jj) = 24. / zstrn(ji,jj)
+!         END DO
+!      END DO
 
 !CDIR NOVERRCHK
@@ -304,11 +330,11 @@
               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) - zpronew(ji,jj,jk) - zpronewd(ji,jj,jk)
               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zproreg - zproreg2
-              tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zprorca(ji,jj,jk) * zexcret
-              tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) + zprochln(ji,jj,jk) * zexcret
-              tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) + zprofen(ji,jj,jk) * zexcret
-              tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) + zprorcad(ji,jj,jk) * zexcret2
-              tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) + zprochld(ji,jj,jk) * zexcret2
-              tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) + zprofed(ji,jj,jk) * zexcret2
-              tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) + zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) * zexcret2
+              tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) + zprorca(ji,jj,jk) * texcret
+              tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) + zprochln(ji,jj,jk) * texcret
+              tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) + zprofen(ji,jj,jk) * texcret
+              tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) + zprorcad(ji,jj,jk) * texcret2
+              tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) + zprochld(ji,jj,jk) * texcret2
+              tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) + zprofed(ji,jj,jk) * texcret2
+              tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) + zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) * texcret2
               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + &
               &                     excret2 * zprorcad(ji,jj,jk) + excret * zprorca(ji,jj,jk)
@@ -316,7 +342,7 @@
               &                    + ( o2ut + o2nit ) * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) )
               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) &
-              &                     - zexcret * zprofen(ji,jj,jk) - zexcret2 * zprofed(ji,jj,jk)
+              &                     - texcret * zprofen(ji,jj,jk) - texcret2 * zprofed(ji,jj,jk)
               tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) &
-              &                     - zexcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk)
+              &                     - texcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk)
               tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprorca(ji,jj,jk) - zprorcad(ji,jj,jk)
               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) &
@@ -405,4 +431,8 @@
       ENDIF
 
+      rpis180   = rpi / 180.
+      texcret   = 1.0 - excret
+      texcret2  = 1.0 - excret2
+
    END SUBROUTINE p4z_prod_init
 
Index: trunk/NEMO/TOP_SRC/PISCES/p4zrem.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 1073)
@@ -17,5 +17,5 @@
    USE oce_trc         !
    USE trp_trc         ! 
-   USE sms             ! 
+   USE sms_pisces      ! 
    USE prtctl_trc
    USE p4zint
@@ -31,10 +31,12 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   xremik  = 0.3_wp      ,  & !:
-     &                   xremip  = 0.025_wp    ,  & !:
-     &                   nitrif  = 0.05_wp     ,  & !:
-     &                   xsirem  = 0.015_wp    ,  & !:
-     &                   xlam1   = 0.005_wp    ,  & !:
-     &                   oxymin  = 1.e-6_wp         !:
+   REAL(wp), PUBLIC ::   &
+     xremik  = 0.3_wp      ,  & !:
+     xremip  = 0.025_wp    ,  & !:
+     nitrif  = 0.05_wp     ,  & !:
+     xsirem  = 0.015_wp    ,  & !:
+     xlam1   = 0.005_wp    ,  & !:
+     oxymin  = 1.e-6_wp         !:
+
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::    & !:
      &                   denitr                     !: denitrification array
Index: trunk/NEMO/TOP_SRC/PISCES/p4zsed.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 1073)
@@ -18,5 +18,5 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
    USE lib_mpp
    USE prtctl_trc
@@ -34,14 +34,16 @@
    PRIVATE
 
-   PUBLIC   p4z_sed    ! called in p4zprg.F90
+   PUBLIC   p4z_sed   
 
    !! * Shared module variables
-   LOGICAL, PUBLIC ::    bdustfer = .FALSE.      ,  &  !:
-     &                   briver = .FALSE.        ,  &  !:
-     &                   bndepo = .FALSE.        ,  &  !:
-     &                   bsedinput = .FALSE.           !:
-
-   REAL(wp), PUBLIC ::   sedfeinput = 1.E-9_wp   ,  &  !:
-     &                   dustsolub  = 0.014_wp         !:
+   LOGICAL, PUBLIC ::    &
+     bdustfer  = .FALSE.      ,  &  !:
+     briver    = .FALSE.      ,  &  !:
+     bndepo    = .FALSE.      ,  &  !:
+     bsedinput = .FALSE.            !:
+
+   REAL(wp), PUBLIC ::   &
+     sedfeinput = 1.E-9_wp   ,  &  !:
+     dustsolub  = 0.014_wp         !:
 
    !! * Module variables
Index: trunk/NEMO/TOP_SRC/PISCES/p4zsink.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 1073)
@@ -13,6 +13,5 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
-   USE p4zsink2        !
+   USE sms_pisces
    USE prtctl_trc
 
@@ -615,4 +614,110 @@
 #endif
 
+   SUBROUTINE p4z_sink2( pwsink, psinkflx, jp_tra )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_sink2  ***
+      !!
+      !! ** 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).
+      !!---------------------------------------------------------------------
+      INTEGER , INTENT(in   )                         ::   jp_tra    ! tracer index index      
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   pwsink    ! sinking speed
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   psinkflx  ! sinking fluxe
+      !!
+      INTEGER  ::   ji, jj, jk, jn
+      REAL(wp) ::   zigma,zew,zstep,zign, zflx
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  ztraz, zakz
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwsink2
+      !!---------------------------------------------------------------------
+
+      zstep  = rfact2 / 2.
+
+      ztraz(:,:,:) = 0.e0
+      zakz (:,:,:) = 0.e0
+
+      DO jk = 1, jpkm1
+# if defined key_off_degrad
+         zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rjjss * tmask(:,:,jk+1) * facvol(:,:,jk)
+# else
+         zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rjjss * tmask(:,:,jk+1)
+# endif
+      END DO
+      zwsink2(:,:,1) = 0.e0
+
+
+      ! Vertical advective flux
+      DO jn = 1, 2
+         !  first guess of the slopes interior values
+         DO jk = 2, jpkm1
+            ztraz(:,:,jk) = ( trn(:,:,jk-1,jp_tra) - trn(:,:,jk,jp_tra) ) * tmask(:,:,jk)
+         END DO
+         ztraz(:,:,1  ) = 0.0
+         ztraz(:,:,jpk) = 0.0
+
+         ! slopes
+         DO jk = 2, jpkm1
+            DO jj = 1,jpj
+               DO ji = 1, jpi
+                  zign = 0.25 + SIGN( 0.25, ztraz(ji,jj,jk) * ztraz(ji,jj,jk+1) )
+                  zakz(ji,jj,jk) = ( ztraz(ji,jj,jk) + ztraz(ji,jj,jk+1) ) * zign
+               END DO
+            END DO
+         END DO
+         
+         ! 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) ) )
+               END DO
+            END DO
+         END DO
+         
+         ! vertical advective flux
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj      
+               DO ji = 1, jpi    
+                  zigma = zwsink2(ji,jj,jk+1) * zstep / fse3w(ji,jj,jk+1)
+                  zew   = zwsink2(ji,jj,jk+1)
+                  psinkflx(ji,jj,jk+1) = -zew * ( trn(ji,jj,jk,jp_tra) - 0.5 * ( 1 + zigma ) * zakz(ji,jj,jk) ) * zstep
+               END DO
+            END DO
+         END DO
+         !
+         ! Boundary conditions
+         psinkflx(:,:,1  ) = 0.e0
+         psinkflx(:,:,jpk) = 0.e0
+         
+         DO jk=1,jpkm1
+            DO jj = 1,jpj
+               DO ji = 1, jpi
+                  zflx = ( psinkflx(ji,jj,jk) - psinkflx(ji,jj,jk+1) ) / fse3t(ji,jj,jk)
+                  trn(ji,jj,jk,jp_tra) = trn(ji,jj,jk,jp_tra) + zflx
+               END DO
+            END DO
+         END DO
+
+      ENDDO
+
+      DO jk=1,jpkm1
+         DO jj = 1,jpj
+            DO ji = 1, jpi
+               zflx = ( psinkflx(ji,jj,jk) - psinkflx(ji,jj,jk+1) ) / fse3t(ji,jj,jk)
+               trb(ji,jj,jk,jp_tra) = trb(ji,jj,jk,jp_tra) + 2. * zflx
+            END DO
+         END DO
+      END DO
+
+      trn(:,:,:,jp_tra) = trb(:,:,:,jp_tra)
+      psinkflx(:,:,:)   = 2. * psinkflx(:,:,:)
+
+      !
+   END SUBROUTINE p4z_sink2
+
 #else
    !!======================================================================
Index: trunk/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 1073)
+++ trunk/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 1073)
@@ -0,0 +1,80 @@
+MODULE sms_pisces   
+   !!----------------------------------------------------------------------
+   !!                     ***  sms_pisces.F90  ***  
+   !! TOP :   PISCES Source Minus Sink variables
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2000-02 (O. Aumont) original code
+   !!----------------------------------------------------------------------
+
+#if defined key_pisces
+   !!----------------------------------------------------------------------
+   !!   'key_pisces'                                         PISCES model
+   !!----------------------------------------------------------------------
+   USE par_oce
+   USE par_trc
+
+   IMPLICIT NONE
+   PUBLIC
+
+   !!----------------------------------------------------------------------
+   !! 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), DIMENSION(jpi,jpj,jpk) ::   akb3, ak13, ak23, aksp, akw3             !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   hi, borat                                !: ???
+
+   !!----------------------------------------------------------------------
+   !!  Time variables
+   !! ---------------------------------------------------------------------
+   INTEGER  ::   nrdttrc, ndayflxtr       !: ???
+   REAL(wp) ::   rfact, rfactr, rfact2, rfact2r   !: ???
+
+   !!---------------------------------------
+   !!  Biological parameters 
+   !! --------------------------------------
+   !
+   REAL(wp) ::   part, rno3, o2ut, po4r, rdenit, o2nit     !: ???
+   REAL(wp) ::   wsbio, wsbio2, xkmort, ferat3                     !: ???
+
+   !!---------------------------------------------
+   !!  Biological fluxes for light
+   !!---------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   etot3                 !: ???
+
+!!----------------------------------------------------------
+!!  Biological fluxes for primary production
+!!----------------------------------------------------------
+   REAL(wp), DIMENSION(jpi,jpj) :: xksi, xksimax
+   !
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xnanono3, xdiatno3, xnanonh4, xdiatnh4       !: ???
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xlimphy, xlimdia, concdfe, concnfe !: ???
+
+   !!---------------------------------------------
+   !!  SMS for the organic matter
+   !!---------------------------------------------
+   !
+   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xfracal, nitrfac, xlimbac, xdiss                  !: ??
+
+#if defined key_kriest
+   !!---------------------------------------------------------
+   !!  Kriest parameter for aggregation
+   !!---------------------------------------------------------
+   REAL(wp) ::  xkr_eta, xkr_zeta
+   REAL(wp) ::  xkr_mass_min, xkr_mass_max, xkr_massp
+#endif
+
+#else
+   !!----------------------------------------------------------------------   
+   !!  Empty module :                                     NO PISCES model
+   !!----------------------------------------------------------------------
+#endif
+   
+   !!======================================================================   
+END MODULE sms_pisces    
+
Index: trunk/NEMO/TOP_SRC/PISCES/trcctl_pisces.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/trcctl_pisces.F90	(revision 1073)
+++ trunk/NEMO/TOP_SRC/PISCES/trcctl_pisces.F90	(revision 1073)
@@ -0,0 +1,70 @@
+MODULE trcctl_pisces
+   !!======================================================================
+   !!                         ***  trcctl_pisces.F90  ***
+   !! TOP :                Control of PISCES biogeochemical model
+   !!======================================================================
+   !!----------------------------------------------------------------------
+   !! History :   1.0  !  2000-12 (C. Ethe) assign a parameter to name individual tracers
+   !!----------------------------------------------------------------------
+
+#if defined key_pisces
+
+   USE oce_trc
+   USE trc
+
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC trc_ctl_pisces     ! called by ???
+
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 
+   !! $Id: trcctl.lobster1.h90 764 2007-12-14 06:32:58Z gm $ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE trc_ctl_pisces
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_ctl_pisces  ***
+      !!
+      !! ** Purpose :   control the cpp options, namelist and files 
+      !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' use PISCES biological model '
+
+   ! Check number of tracers
+   ! -----------------------
+#if  defined key_kriest
+      IF( jp_pisces /= 23) THEN 
+#else
+      IF( jp_pisces /= 24) THEN
+#endif
+          IF (lwp) THEN 
+              WRITE (numout,*) ' ===>>>> : w a r n i n g '
+              WRITE (numout,*) ' =======   ============= '
+              WRITE (numout,*)                               &
+              &   ' STOP, change jp_pisces',               & 
+              &   ' in par_pisces.F90'  
+          END IF 
+          STOP 'TRC_CTL'
+      END IF 
+
+   END SUBROUTINE trc_ctl_pisces
+
+#else
+   !!----------------------------------------------------------------------
+   !!  Empty module :                                            No PISCES
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_ctl_pisces                 ! Dummy routine
+   END SUBROUTINE trc_ctl_pisces
+#endif
+
+   !!======================================================================
+END MODULE trcctl_pisces
+      
Index: trunk/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 1073)
@@ -17,5 +17,5 @@
    !!----------------------------------------------------------------------
    USE par_trc         ! TOP parameters
-   USE sms             ! Source Minus Sink variables
+   USE sms_pisces      ! Source Minus Sink variables
    USE trc
    USE oce_trc         ! ocean variables
Index: trunk/NEMO/TOP_SRC/PISCES/trclsm_pisces.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/trclsm_pisces.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/trclsm_pisces.F90	(revision 1073)
@@ -18,5 +18,5 @@
    USE par_trc         ! TOP parameters
    USE trc             ! TOP variables
-   USE sms             ! sms trends
+   USE sms_pisces      ! sms trends
 
 
Index: trunk/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
===================================================================
--- trunk/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 1072)
+++ trunk/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 1073)
@@ -15,5 +15,5 @@
    USE oce_trc         !
    USE trp_trc
-   USE sms
+   USE sms_pisces
    USE lbclnk
    USE lib_mpp
@@ -53,17 +53,9 @@
       !!
       INTEGER ::   jnt, jn
-      INTEGER ::   iyy, imm, idd
-
-
       !!---------------------------------------------------------------------
 
-
-      iyy = ndastp/10000
-      imm = (ndastp - iyy*10000)/100
-      idd = (ndastp - iyy*10000 - imm*100)
-
-      IF( ndayflxtr /= idd) THEN      ! New days
+      IF( ndayflxtr /= nday ) THEN      ! New days
          !
-         ndayflxtr = idd
+         ndayflxtr = nday
 
          CALL p4z_che          ! computation of chemical constants
