Index: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4528)
+++ trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4529)
@@ -71,12 +71,12 @@
       REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit
       REAL(wp) ::  zsiloss, zcaloss, zws3, zws4, zwsc, zdep, zwstpoc
-      REAL(wp) ::  ztrfer, ztrpo4, zwdust
+      REAL(wp) ::  ztrfer, ztrpo4, zwdust, zlight
       REAL(wp) ::  zrdenittot, zsdenittot, znitrpottot
       !
       CHARACTER (len=25) :: charout
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zpdep, zsidep, zwork1, zwork2, zwork3, zwork4
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zironice
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zironice, zbureff
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zwsbio3, zwsbio4, zwscal
-      REAL(wp), POINTER, DIMENSION(:,:,:) :: znitrpot, zirondep
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: znitrpot, zirondep, zsoufer
       !!---------------------------------------------------------------------
       !
@@ -93,9 +93,10 @@
       !
       ! Allocate temporary workspace
-      CALL wrk_alloc( jpi, jpj, zdenit2d, zwork1, zwork2, zwork3, zwork4 )
+      CALL wrk_alloc( jpi, jpj, zdenit2d, zwork1, zwork2, zwork3, zwork4, zbureff )
       CALL wrk_alloc( jpi, jpj, zwsbio3, zwsbio4, zwscal )
-      CALL wrk_alloc( jpi, jpj, jpk, znitrpot )
+      CALL wrk_alloc( jpi, jpj, jpk, znitrpot, zsoufer )
 
       zdenit2d(:,:) = 0.e0
+      zbureff (:,:) = 0.e0
 
       ! Iron input/uptake due to sea ice : Crude parameterization based on Lancelot et al.
@@ -131,14 +132,15 @@
          !                                              ! Iron and Si deposition at the surface
          IF( ln_solub ) THEN
-            zirondep(:,:,1) = solub(:,:) * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss 
+            zirondep(:,:,1) = solub(:,:) * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss 
          ELSE
-            zirondep(:,:,1) = dustsolub  * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss 
+            zirondep(:,:,1) = dustsolub  * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss 
          ENDIF
-         zsidep(:,:) = 8.8 * 0.075 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 28.1  * rmtss )
-         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss ) / po4r 
+         zsidep(:,:) = 8.8 * 0.075 * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / ( 28.1  * rmtss )
+         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss ) / po4r 
          !                                              ! Iron solubilization of particles in the water column
-         zwdust = 0.005 / ( wdust * 55.85 * 30.42 ) / ( 45. * rday ) 
+         !                                              ! dust in kg/m2/s ---> 1/55.85 to put in mol/Fe ;  wdust in m/j
+         zwdust = 0.03 * rday / ( wdust * 55.85 ) / ( 270. * rday )
          DO jk = 2, jpkm1
-            zirondep(:,:,jk) = dust(:,:) * zwdust * rfact2 * EXP( -fsdept(:,:,jk) / 1000. )
+            zirondep(:,:,jk) = dust(:,:) * mfrac * zwdust * rfact2 * EXP( -fsdept(:,:,jk) / 540. )
          END DO
          !                                              ! Iron solubilization of particles in the water column
@@ -152,5 +154,5 @@
                IF( jnt == nrdttrc ) THEN
                   CALL iom_put( "Irondep", zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron
-                  CALL iom_put( "pdust"  , dust(:,:) / ( wdust * 30.42 * 0.035 )  * tmask(:,:,1) ) ! dust concentration at surface
+                  CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface
                ENDIF
             ELSE
@@ -215,4 +217,5 @@
 #if ! defined key_sed
       ! Computation of the sediment denitrification proportion: The metamodel from midlleburg (2006) is being used
+      ! Computation of the fraction of organic matter that is permanently buried from Dunne's model
       ! -------------------------------------------------------
       DO jj = 1, jpj
@@ -233,7 +236,12 @@
               &                + 0.4721 * zo2 - 0.0996 * zdep + 0.4256 * zflx * zo2
               zdenit2d(ji,jj) = 10.0**( zdenit2d(ji,jj) )
+              !
+              zflx = (  trn(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
+                &     + trn(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) ) * 1E6
+              zbureff(ji,jj) = 0.013 + 0.53 * zflx**2 / ( 7.0 + zflx )**2
            ENDIF
          END DO
       END DO 
+
       ! Loss of biogenic silicon, Caco3 organic carbon in the sediments. 
       ! First, the total loss is computed.
@@ -266,5 +274,4 @@
 #if ! defined key_sed
       zrivsil =  1._wp - ( sumdepsi + rivdsiinput * r1_ryyss ) / zsumsedsi
-      zrivno3 =  1._wp - ( rivdininput * r1_ryyss ) / zsumsedpo4
 #endif
 
@@ -301,4 +308,5 @@
             zws4 = zwsbio4(ji,jj) * zdep
             zws3 = zwsbio3(ji,jj) * zdep
+            zrivno3 = 1. - zbureff(ji,jj)
 # if ! defined key_kriest
             trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) - trn(ji,jj,ikt,jpgoc) * zws4
@@ -334,9 +342,10 @@
 
       ! Nitrogen fixation process
+      ! Small source iron from particulate inorganic iron
       !-----------------------------------
       DO jk = 1, jpkm1
          DO jj = 1, jpj
             DO ji = 1, jpi
-               !                                       ! Potential nitrogen fixation dependant on temperature and iron
+               !                      ! Potential nitrogen fixation dependant on temperature and iron
                zlim = ( 1.- xnanono3(ji,jj,jk) - xnanonh4(ji,jj,jk) )
                IF( zlim <= 0.2 )   zlim = 0.01
@@ -348,21 +357,11 @@
                ztrfer = biron(ji,jj,jk)       / ( concfediaz + biron(ji,jj,jk)       )
                ztrpo4 = trn  (ji,jj,jk,jppo4) / ( concnnh4   + trn  (ji,jj,jk,jppo4) ) 
+               zlight =  ( 1.- EXP( -etot(ji,jj,jk) / diazolight ) ) 
                znitrpot(ji,jj,jk) =  MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * r1_rday )   &
-                 &         *  zfact * MIN( ztrfer, ztrpo4 ) * ( 1.- EXP( -etot(ji,jj,jk) / diazolight ) )
+                 &         *  zfact * MIN( ztrfer, ztrpo4 ) * zlight
+               zsoufer(ji,jj,jk) = zlight * 2E-11 / (2E-11 + biron(ji,jj,jk))
             END DO
          END DO
       END DO
- 
-      IF( ln_check_mass ) THEN
-         ! The total gain from nitrogen fixation is scaled to balance the loss by denitrification
-         ! -------------------------------------------------------------
-         zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) )
-         zsdenittot   = glob_sum ( zwork4(:,:)   * e1e2t(:,:) )
-         znitrpottot  = glob_sum ( znitrpot(:,:,:)                        * cvol(:,:,:) )
-         IF( kt == nitend .AND. jnt == nrdttrc ) THEN
-            zfact = 1.e+3 * rfact2r * rno3 * 365. * 86400. * 14. / 1e12
-            IF(lwp) WRITE(numnit,9100) ndastp, znitrpottot * nitrfix * zfact, zrdenittot * zfact , zsdenittot * zfact
-         ENDIF
-       ENDIF
 
       ! Nitrogen change due to nitrogen fixation
@@ -371,13 +370,28 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               ! zfact = znitrpot(ji,jj,jk) * ( zrdenittot + zsdenittot ) / znitrpottot
                zfact = znitrpot(ji,jj,jk) * nitrfix
                trn(ji,jj,jk,jpnh4) = trn(ji,jj,jk,jpnh4) +             zfact
                trn(ji,jj,jk,jptal) = trn(ji,jj,jk,jptal) + rno3      * zfact
                trn(ji,jj,jk,jpoxy) = trn(ji,jj,jk,jpoxy) + o2nit     * zfact 
-               trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + 30. / 46. * zfact
+               trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + concdnh4 / ( concdnh4 + trn(ji,jj,jk,jppo4) ) &
+               &                     * 0.002 * trn(ji,jj,jk,jpdoc) * rfact2 / rday
+               trn(ji,jj,jk,jpfer) = trn(ji,jj,jk,jpfer) + 0.002 * 4E-10 * zsoufer(ji,jj,jk) * rfact2 / rday
            END DO
          END DO 
       END DO
+
+ 
+      IF( ln_check_mass ) THEN
+        ! Global budget of N SMS : denitrification in the water column and in the sediment
+         !                          nitrogen fixation by the diazotrophs
+         ! --------------------------------------------------------------------------------
+         zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) )
+         zsdenittot   = glob_sum ( zwork4(:,:)   * e1e2t(:,:) )
+         znitrpottot  = glob_sum ( znitrpot(:,:,:) * nitrfix              * cvol(:,:,:) )
+         IF( kt == nitend .AND. jnt == nrdttrc ) THEN
+            zfact = 1.e+3 * rfact2r * rno3 * ryyss * 14. / 1e12
+            IF(lwp) WRITE(numnit,9100) ndastp, znitrpottot * nitrfix * zfact, zrdenittot * zfact , zsdenittot * zfact
+         ENDIF
+       ENDIF
       !
       IF( ln_diatrc ) THEN
