Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2967)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2968)
@@ -90,5 +90,5 @@
       REAL(wp) ::   zratio, zmax, zsilim, ztn, zadap
       REAL(wp) ::   zlim, zsilfac2, zsiborn, zprod, zetot2, zproreg, zproreg2
-      REAL(wp) ::   zmxltst, zmxlday
+      REAL(wp) ::   zmxltst, zmxlday, zmaxday
       REAL(wp) ::   zpislopen  , zpislope2n
       REAL(wp) ::   zrum, zcodel, zargu, zval
@@ -295,6 +295,4 @@
                   zprbio(ji,jj,jk) = zprbio(ji,jj,jk) * zmixnano(ji,jj)
                   zprdia(ji,jj,jk) = zprdia(ji,jj,jk) * zmixdiat(ji,jj)
-                  zprnch(ji,jj,jk) = zprnch(ji,jj,jk) * zmixnano(ji,jj)
-                  zprdch(ji,jj,jk) = zprdch(ji,jj,jk) * zmixdiat(ji,jj)
                ENDIF
             END DO
@@ -302,12 +300,5 @@
       END DO
 
-     IF( ln_newprod ) THEN
-        zprochln(:,:,:) = chlcmin * 12. * zprorca (:,:,:)
-        zprochld(:,:,:) = chlcmin * 12. * zprorcad(:,:,:)
-     ELSE
-        zprochln(:,:,:) = 0._wp
-        zprochld(:,:,:) = 0._wp
-     ENDIF
-
+      ! Computation of the various production terms 
 !CDIR NOVERRCHK
       DO jk = 1, jpkm1
@@ -316,13 +307,8 @@
 !CDIR NOVERRCHK
             DO ji = 1, jpi
-
                IF( etot(ji,jj,jk) > 1.E-3 ) THEN
-                  !     Computation of the various production terms for nanophyto.
-                  zetot2 = enano(ji,jj,jk) * zstrn(ji,jj)
+                  !  production terms for nanophyto.
                   zprorca(ji,jj,jk) = zprbio(ji,jj,jk)  * xlimphy(ji,jj,jk) * trn(ji,jj,jk,jpphy) * rfact2
                   zpronew(ji,jj,jk) = zprorca(ji,jj,jk) * xnanono3(ji,jj,jk) / ( xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) + rtrn )
-                  !
-                  zprod = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * xlimphy(ji,jj,jk)
-                  zprochln(ji,jj,jk) = zprochln(ji,jj,jk) + chlcnm * 12. * zprod / (  zpislopead(ji,jj,jk) * zetot2 +rtrn)
                   !
                   zratio = trn(ji,jj,jk,jpnfe) / ( trn(ji,jj,jk,jpphy) + rtrn )
@@ -333,23 +319,7 @@
                   &             * trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concnfe(ji,jj,jk) )  &
                   &             * zmax * trn(ji,jj,jk,jpphy) * rfact2
-               ENDIF
-            END DO
-         END DO
-      END DO
-
-!CDIR NOVERRCHK
-      DO jk = 1, jpkm1
-!CDIR NOVERRCHK
-         DO jj = 1, jpj
-!CDIR NOVERRCHK
-            DO ji = 1, jpi
-               IF( etot(ji,jj,jk) > 1.E-3 ) THEN
-                  !  Computation of the various production terms for diatoms
-                  zetot2 = ediat(ji,jj,jk) * zstrn(ji,jj)
+                  !  production terms for diatomees
                   zprorcad(ji,jj,jk) = zprdia(ji,jj,jk) * xlimdia(ji,jj,jk) * trn(ji,jj,jk,jpdia) * rfact2
                   zpronewd(ji,jj,jk) = zprorcad(ji,jj,jk) * xdiatno3(ji,jj,jk) / ( xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) + rtrn )
-                  !
-                  zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * xlimdia(ji,jj,jk)
-                  zprochld(ji,jj,jk) = zprochld(ji,jj,jk) + chlcdm * 12. * zprod / ( zpislopead2(ji,jj,jk) * zetot2 +rtrn )
                   !
                   zratio = trn(ji,jj,jk,jpdfe) / ( trn(ji,jj,jk,jpdia) + rtrn )
@@ -364,4 +334,52 @@
          END DO
       END DO
+
+      IF( ln_newprod ) THEN
+!CDIR NOVERRCHK
+         DO jk = 1, jpkm1
+!CDIR NOVERRCHK
+            DO jj = 1, jpj
+!CDIR NOVERRCHK
+               DO ji = 1, jpi
+                  IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN
+                     zprnch(ji,jj,jk) = zprnch(ji,jj,jk) * zmixnano(ji,jj)
+                     zprdch(ji,jj,jk) = zprdch(ji,jj,jk) * zmixdiat(ji,jj)
+                  ENDIF
+                  IF( etot(ji,jj,jk) > 1.E-3 ) THEN
+                     !  production terms for nanophyto. ( chlorophyll )
+                     znanotot = enano(ji,jj,jk) * zstrn(ji,jj)
+                     zprod    = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * xlimphy(ji,jj,jk)
+                     zprochln(ji,jj,jk) = chlcmin * 12. * zprorca (ji,jj,jk)
+                     zprochln(ji,jj,jk) = zprochln(ji,jj,jk) + chlcnm * 12. * zprod / (  zpislopead(ji,jj,jk) * znanotot +rtrn)
+                     !  production terms for diatomees ( chlorophyll )
+                     zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj)
+                     zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * xlimdia(ji,jj,jk)
+                     zprochld(ji,jj,jk) = chlcmin * 12. * zprorcad(ji,jj,jk)
+                     zprochld(ji,jj,jk) = zprochld(ji,jj,jk) + chlcdm * 12. * zprod / ( zpislopead2(ji,jj,jk) * zdiattot +rtrn )
+                  ENDIF
+               END DO
+            END DO
+         END DO
+      ELSE
+!CDIR NOVERRCHK
+         DO jk = 1, jpkm1
+!CDIR NOVERRCHK
+            DO jj = 1, jpj
+!CDIR NOVERRCHK
+               DO ji = 1, jpi
+                  IF( etot(ji,jj,jk) > 1.E-3 ) THEN
+                     !  production terms for nanophyto. ( chlorophyll )
+                     znanotot = enano(ji,jj,jk) * zstrn(ji,jj)
+                     zprod = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * trn(ji,jj,jk,jpphy) * xlimphy(ji,jj,jk)
+                     zprochln(ji,jj,jk) = chlcnm * 144. * zprod / (  zpislopead(ji,jj,jk) * trn(ji,jj,jk,jpnch) * znanotot +rtrn)
+                     !  production terms for diatomees ( chlorophyll )
+                     zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj)
+                     zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * trn(ji,jj,jk,jpdia) * xlimdia(ji,jj,jk)
+                     zprochld(ji,jj,jk) = chlcdm * 144. * zprod / ( zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch) * zdiattot +rtrn )
+                  ENDIF
+               END DO
+            END DO
+         END DO
+      ENDIF
 
       !   Update the arrays TRA which contain the biological sources and sinks
Index: branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2967)
+++ branches/2011/dev_r2787_PISCES_improvment/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2968)
@@ -230,5 +230,5 @@
          ENDIF
          ! Control of date 
-         IF( nit000  - NINT( zkt ) /= 1 .AND.  nn_rsttr /= 0 )                                  &
+         IF( nit000  - NINT( zkt ) /= nn_dttrc .AND.  nn_rsttr /= 0 )                                  &
             &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 &
             &                  ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' )
