Index: branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90
===================================================================
--- branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 3443)
+++ branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90	(revision 3446)
@@ -19,4 +19,5 @@
    USE sms_pisces      ! PISCES variables
    USE p4zopt          ! Optical
+   USE iom             !  I/O manager
 
    IMPLICIT NONE
@@ -33,4 +34,6 @@
    REAL(wp), PUBLIC ::  concnfer  = 1.e-9_wp      !:  Iron half saturation for nanophyto 
    REAL(wp), PUBLIC ::  concdfer  = 2.e-9_wp      !:  Iron half saturation for diatoms  
+   REAL(wp), PUBLIC ::  concbno3  = 2.5e-7_wp      !:  NO3 half saturation  for bacteria 
+   REAL(wp), PUBLIC ::  concbnh4  = 2.5e-8_wp      !:  NH4 half saturation for bacteria
    REAL(wp), PUBLIC ::  xsizedia  = 5.e-7_wp      !:  Minimum size criteria for diatoms
    REAL(wp), PUBLIC ::  xsizephy  = 1.e-6_wp      !:  Minimum size criteria for nanophyto
@@ -59,5 +62,5 @@
 CONTAINS
 
-   SUBROUTINE p4z_lim( kt )
+   SUBROUTINE p4z_lim( kt, jnt )
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE p4z_lim  ***
@@ -69,5 +72,5 @@
       !!---------------------------------------------------------------------
       !
-      INTEGER, INTENT(in)  :: kt
+      INTEGER, INTENT(in)  :: kt, jnt
       !
       INTEGER  ::   ji, jj, jk
@@ -89,5 +92,5 @@
                zno3    = trn(ji,jj,jk,jpno3) / 40.e-6
                zferlim = MAX( 3e-11 * zno3 * zno3, 5e-12 )
-               zferlim = MIN( zferlim, 3e-11 )
+               zferlim = MIN( zferlim, 5e-11 )
                trn(ji,jj,jk,jpfer) = MAX( trn(ji,jj,jk,jpfer), zferlim )
 
@@ -110,4 +113,17 @@
                zconc0nnh4        = MAX( concnnh4, ( zconcn2 * concnnh4 + concnnh4 * xsizern * zconcn ) * z1_trnphy )
 
+               ! Michaelis-Menten Limitation term for nutrients Small bacteria
+               ! -------------------------------------------------------------
+               zdenom = 1. /  ( concbno3 * concbnh4 + concbnh4 * trn(ji,jj,jk,jpno3) + concbno3 * trn(ji,jj,jk,jpnh4) )
+               xnanono3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * concbnh4 * zdenom
+               xnanonh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * concbno3 * zdenom
+               !
+               zlim1    = xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk)
+               zlim2    = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concbnh4 )
+               zlim3    = trn(ji,jj,jk,jpfer) / ( concbfe + trn(ji,jj,jk,jpfer) )
+               zlim4    = trn(ji,jj,jk,jpdoc) / ( xkdoc   + trn(ji,jj,jk,jpdoc) )
+               xlimbacl(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 )
+               xlimbac (ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4
+
                ! Michaelis-Menten Limitation term for nutrients Small flagellates
                ! -----------------------------------------------
@@ -124,8 +140,4 @@
                xlimphy(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 )
                !
-               zlim3    = trn(ji,jj,jk,jpfer) / ( concbfe + trn(ji,jj,jk,jpfer) )
-               zlim4    = trn(ji,jj,jk,jpdoc) / ( xkdoc   + trn(ji,jj,jk,jpdoc) )
-               xlimbac(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4
-
                !   Michaelis-Menten Limitation term for nutrients Diatoms
                !   ----------------------------------------------
@@ -137,5 +149,5 @@
                zlim2    = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + zconc1dnh4  )
                zlim3    = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi(ji,jj) )
-               zratio   = trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn)
+               zratio   = trn(ji,jj,jk,jpdfe) * z1_trndia
                zironmin = xcoef1 * trn(ji,jj,jk,jpdch) * z1_trndia + xcoef2 * zlim1 + xcoef3 * xdiatno3(ji,jj,jk)
                zlim4    = MAX( 0., ( zratio - zironmin ) / qdfelim )
@@ -155,14 +167,14 @@
                   &   / ( concnno3 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3) + concnno3 * trn(ji,jj,jk,jpnh4) ) 
                zlim2  = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concnnh4 )
-               zlim3  = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concbfe  )
+               zlim3  = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) +  5.E-11   )
                ztem1  = MAX( 0., tsn(ji,jj,jk,jp_tem) )
                ztem2  = tsn(ji,jj,jk,jp_tem) - 10.
                zetot1 = MAX( 0., etot(ji,jj,jk) - 1.) / ( 4. + etot(ji,jj,jk) ) 
-               zetot2 = 1. / ( 30. + etot(ji,jj,jk) ) 
+               zetot2 = 30. / ( 30. + etot(ji,jj,jk) ) 
 
                xfracal(ji,jj,jk) = caco3r * MIN( zlim1, zlim2, zlim3 )                  &
                   &                       * ztem1 / ( 0.1 + ztem1 )                     &
                   &                       * MAX( 1., trn(ji,jj,jk,jpphy) * 1.e6 / 2. )  &
-                  &                       * 2.325 * zetot1 * 30. * zetot2               &
+                  &                       * zetot1 * zetot2               &
                   &                       * ( 1. + EXP(-ztem2 * ztem2 / 25. ) )         &
                   &                       * MIN( 1., 50. / ( hmld(ji,jj) + rtrn ) )
@@ -173,4 +185,15 @@
       END DO
       !
+      IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc ) THEN        ! save output diagnostics
+        !
+        CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht
+        CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        !
+      ENDIF
+
+      !
       IF( nn_timing == 1 )  CALL timing_stop('p4z_lim')
       !
@@ -192,6 +215,6 @@
 
       NAMELIST/nampislim/ concnno3, concdno3, concnnh4, concdnh4, concnfer, concdfer, concbfe,   &
-         &                xsizedia, xsizephy, xsizern, xsizerd, xksi1, xksi2, xkdoc,         & 
-         &                qnfelim, qdfelim, caco3r
+         &                concbno3, concbnh4, xsizedia, xsizephy, xsizern, xsizerd,          & 
+         &                xksi1, xksi2, xkdoc, qnfelim, qdfelim, caco3r
 
       REWIND( numnatp )                     ! read numnat
@@ -203,6 +226,6 @@
          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
          WRITE(numout,*) '    mean rainratio                           caco3r    = ', caco3r
-         WRITE(numout,*) '    NO3 half saturation of nanophyto         concnno3  =  ', concnno3
-         WRITE(numout,*) '    NO3 half saturation of diatoms           concdno3  =  ', concdno3
+         WRITE(numout,*) '    NO3 half saturation of nanophyto         concnno3  = ', concnno3
+         WRITE(numout,*) '    NO3 half saturation of diatoms           concdno3  = ', concdno3
          WRITE(numout,*) '    NH4 half saturation for phyto            concnnh4  = ', concnnh4
          WRITE(numout,*) '    NH4 half saturation for diatoms          concdnh4  = ', concdnh4
@@ -214,4 +237,6 @@
          WRITE(numout,*) '    size ratio for nanophytoplankton         xsizern   = ', xsizern
          WRITE(numout,*) '    size ratio for diatoms                   xsizerd   = ', xsizerd
+         WRITE(numout,*) '    NO3 half saturation of bacteria          concbno3  = ', concbno3
+         WRITE(numout,*) '    NH4 half saturation for bacteria         concbnh4  = ', concbnh4
          WRITE(numout,*) '    Minimum size criteria for diatoms        xsizedia  = ', xsizedia
          WRITE(numout,*) '    Minimum size criteria for nanophyto      xsizephy  = ', xsizephy
