Index: branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90
===================================================================
--- branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90	(revision 7192)
+++ branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p5zprod.F90	(revision 7195)
@@ -41,7 +41,4 @@
    REAL(wp), PUBLIC ::  chlcmin         !:
    REAL(wp), PUBLIC ::  grosip          !:
-   REAL(wp), PUBLIC ::  xlimmxln        !:
-   REAL(wp), PUBLIC ::  xlimmxlp        !:
-   REAL(wp), PUBLIC ::  xlimmxld        !:
 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prmaxn   !: optimal production = f(temperature)
@@ -149,13 +146,9 @@
                IF( etot_ndcy(ji,jj,jk) > 1.E-3 ) THEN
                   zval = MAX( 1., zstrn(ji,jj) )
-                  zmxl_fac(ji,jj,jk) = zval
+                  IF( gdepw_n(ji,jj,jk+1) <= hmld(ji,jj) ) THEN
+                     zval = zval * MIN(1., heup_01(ji,jj) / ( hmld(ji,jj) + rtrn ))
+                  ENDIF
                   zmxl_chl(ji,jj,jk) = zval / 24.
-                  IF( gdepw_n(ji,jj,jk+1) <= hmld(ji,jj) ) THEN
-                     zval = MIN(1., heup_01(ji,jj) / ( hmld(ji,jj) + rtrn ))
-                     zmxl_fac(ji,jj,jk) = zmxl_fac(ji,jj,jk) * zval
-                     zmxl_chl(ji,jj,jk) = zmxl_chl(ji,jj,jk) * zval
-                  ENDIF
-                  zmxl_fac(ji,jj,jk) = ( 1. - exp( -0.2 * zmxl_fac(ji,jj,jk) ) )
-                  zmxl_chl(ji,jj,jk) = zmxl_chl(ji,jj,jk)
+                  zmxl_fac(ji,jj,jk) = 1.5 * zval / ( 12. + zval )
                ENDIF
             END DO
@@ -171,5 +164,4 @@
       zdaylen(:,:) = MAX(1., zstrn(:,:)) / 24.
       WHERE( zstrn(:,:) < 1.e0 ) zstrn(:,:) = 24.
-      zstrn(:,:) = 24. / zstrn(:,:)
 
       DO jk = 1, jpkm1
@@ -188,7 +180,7 @@
                      &                    /( trb(ji,jj,jk,jpdia) * 12. + rtrn)
                   !
-                  zpislopen = zpislopeadn(ji,jj,jk) / ( prmaxn(ji,jj,jk) * rday * xlimphy(ji,jj,jk) + rtrn )
-                  zpislopep = zpislopeadp(ji,jj,jk) / ( prmaxp(ji,jj,jk) * rday * xlimpic(ji,jj,jk) + rtrn )
-                  zpisloped = zpislopeadd(ji,jj,jk) / ( prmaxd(ji,jj,jk) * rday * xlimdia(ji,jj,jk) + rtrn )
+                  zpislopen = zpislopeadn(ji,jj,jk) / ( zprbio(ji,jj,jk) * rday * xlimphy(ji,jj,jk) + rtrn )
+                  zpislopep = zpislopeadp(ji,jj,jk) / ( zprpic(ji,jj,jk) * rday * xlimpic(ji,jj,jk) + rtrn )
+                  zpisloped = zpislopeadd(ji,jj,jk) / ( zprdia(ji,jj,jk) * rday * xlimdia(ji,jj,jk) + rtrn )
 
                   ! Computation of production function for Carbon
@@ -264,5 +256,5 @@
                   zmax = MAX(0., MIN(1., (1. - zrat)/ (1.05 - zrat) * 1.05))
                   zpronmax = zprnutmax * zmax * MAX(0., MIN(1., ( zratiop - xqpnmin(ji,jj,jk) )   &
-                  &          / ( xqpnmax(ji,jj,jk) - xqpnmin(ji,jj,jk) ), xlimnfe(ji,jj,jk) ) )
+                  &          / ( xqpnmax(ji,jj,jk) - xqpnmin(ji,jj,jk) + rtrn ), xlimnfe(ji,jj,jk) ) )
                   zpronewn(ji,jj,jk) = zpronmax * zdaylen(ji,jj) * xnanono3(ji,jj,jk)
                   zproregn(ji,jj,jk) = zpronmax * xnanonh4(ji,jj,jk)
@@ -301,5 +293,5 @@
                   zmax = MAX(0., MIN(1., (1. - zrat)/ (1.05 - zrat) * 1.05))
                   zpronmax = zprnutmax * zmax * MAX(0., MIN(1., ( zratiop - xqppmin(ji,jj,jk) )   &
-                  &          / ( xqppmax(ji,jj,jk) - xqppmin(ji,jj,jk) ), xlimpfe(ji,jj,jk) ) )
+                  &          / ( xqppmax(ji,jj,jk) - xqppmin(ji,jj,jk) + rtrn ), xlimpfe(ji,jj,jk) ) )
                   zpronewp(ji,jj,jk) = zpronmax * zdaylen(ji,jj) * xpicono3(ji,jj,jk) 
                   zproregp(ji,jj,jk) = zpronmax * xpiconh4(ji,jj,jk)
@@ -340,5 +332,5 @@
                   zmax = MAX(0., MIN(1., (1. - zrat)/ (1.05 - zrat) * 1.05)) 
                   zpronmax = zprnutmax * zmax * MAX(0., MIN(1., ( zratiop - xqpdmin(ji,jj,jk) )   &
-                  &          / ( xqpdmax(ji,jj,jk) - xqpdmin(ji,jj,jk) ), xlimdfe(ji,jj,jk) ) )
+                  &          / ( xqpdmax(ji,jj,jk) - xqpdmin(ji,jj,jk) + rtrn ), xlimdfe(ji,jj,jk) ) )
                   zpronewd(ji,jj,jk) = zpronmax * zdaylen(ji,jj) * xdiatno3(ji,jj,jk)
                   zproregd(ji,jj,jk) = zpronmax * xdiatnh4(ji,jj,jk)
@@ -597,6 +589,5 @@
       !
       NAMELIST/namp5zprod/ pislopen, pislopep, pisloped, excretn, excretp, excretd,     &
-         &                 thetannm, thetanpm, thetandm, chlcmin, grosip, bresp, xadap, &
-         &                 xlimmxln, xlimmxlp, xlimmxld
+         &                 thetannm, thetanpm, thetandm, chlcmin, grosip, bresp, xadap
 
       INTEGER :: ios                 ! Local integer output status for namelist read
@@ -629,7 +620,4 @@
          WRITE(numout,*) '    Minimum Chl/N in picophytoplankton        thetanpm     =', thetanpm
          WRITE(numout,*) '    Minimum Chl/N in diatoms                  thetandm     =', thetandm
-         WRITE(numout,*) '    Critical time scale for mixing (nano)     xlimmxln     =', xlimmxln
-         WRITE(numout,*) '    Critical time scale for mixing (pico)     xlimmxlp     =', xlimmxlp
-         WRITE(numout,*) '    Critical time scale for mixing (diatoms)  xlimmxld     =', xlimmxld
       ENDIF
       !
