Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90	(revision 9240)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90	(revision 9241)
@@ -48,12 +48,12 @@
    LOGICAL  ::  ll_solub
 
-   INTEGER , PARAMETER  :: jpriv  = 7   !: Maximum number of river input fields
-   INTEGER , PARAMETER  :: jr_dic = 1   !: index of dissolved inorganic carbon
-   INTEGER , PARAMETER  :: jr_doc = 2   !: index of dissolved organic carbon
-   INTEGER , PARAMETER  :: jr_din = 3   !: index of dissolved inorganic nitrogen
-   INTEGER , PARAMETER  :: jr_don = 4   !: index of dissolved organic nitrogen
-   INTEGER , PARAMETER  :: jr_dip = 5   !: index of dissolved inorganic phosporus
-   INTEGER , PARAMETER  :: jr_dop = 6   !: index of dissolved organic phosphorus
-   INTEGER , PARAMETER  :: jr_dsi = 7   !: index of dissolved silicate
+   INTEGER, PARAMETER  :: jpriv  = 7   !: Maximum number of river input fields
+   INTEGER, PARAMETER  :: jr_dic = 1   !: index of dissolved inorganic carbon
+   INTEGER, PARAMETER  :: jr_doc = 2   !: index of dissolved organic carbon
+   INTEGER, PARAMETER  :: jr_din = 3   !: index of dissolved inorganic nitrogen
+   INTEGER, PARAMETER  :: jr_don = 4   !: index of dissolved organic nitrogen
+   INTEGER, PARAMETER  :: jr_dip = 5   !: index of dissolved inorganic phosporus
+   INTEGER, PARAMETER  :: jr_dop = 6   !: index of dissolved organic phosphorus
+   INTEGER, PARAMETER  :: jr_dsi = 7   !: index of dissolved silicate
 
 
@@ -77,5 +77,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hydrofe   !: Hydrothermal vent supply of iron
 
-   REAL(wp), PUBLIC :: sumdepsi, rivalkinput, rivdicinput, nitdepinput
+   REAL(wp), PUBLIC :: sedsilfrac, sedcalfrac
+   REAL(wp), PUBLIC :: rivalkinput, rivdicinput
    REAL(wp), PUBLIC :: rivdininput, rivdipinput, rivdsiinput
 
@@ -267,5 +268,4 @@
       ! dust input from the atmosphere
       ! ------------------------------
-      sumdepsi  = 0._wp
       IF( ln_dust ) THEN 
          !
@@ -365,5 +365,4 @@
       ! nutrient input from dust
       ! ------------------------
-      nitdepinput = 0._wp
       IF( ln_ndepo ) THEN
          !
@@ -473,4 +472,7 @@
       ENDIF
       !
+      sedsilfrac = 0.03     ! percentage of silica loss in the sediments
+      sedcalfrac = 0.6      ! percentage of calcite loss in the sediments
+      !
       IF( nn_timing == 1 )  CALL timing_stop('p4z_sbc_init')
       !
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 9240)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 9241)
@@ -61,5 +61,4 @@
       INTEGER  ::   ji, jj, jk, ikt
 #if ! defined key_sed
-      REAL(wp) ::   zsumsedsi, zsumsedpo4, zsumsedcal
       REAL(wp) ::   zrivalk, zrivsil, zrivno3
 #endif
@@ -71,5 +70,5 @@
       !
       CHARACTER (len=25) :: charout
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zpdep, zsidep, zwork1, zwork2, zwork3
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: zpdep, zsidep, zwork
       REAL(wp), POINTER, DIMENSION(:,:)   :: zsedcal, zsedsi, zsedc
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zironice, zbureff
@@ -83,5 +82,5 @@
       !
       ! Allocate temporary workspace
-      CALL wrk_alloc( jpi, jpj, zdenit2d, zwork1, zwork2, zwork3, zbureff )
+      CALL wrk_alloc( jpi, jpj, zdenit2d, zbureff )
       CALL wrk_alloc( jpi, jpj, zsedcal,  zsedsi, zsedc )
       CALL wrk_alloc( jpi, jpj, zwsbio3, zwsbio4, zwscal )
@@ -90,7 +89,4 @@
       zdenit2d(:,:) = 0.e0
       zbureff (:,:) = 0.e0
-      zwork1  (:,:) = 0.e0
-      zwork2  (:,:) = 0.e0
-      zwork3  (:,:) = 0.e0
       zsedsi   (:,:) = 0.e0
       zsedcal  (:,:) = 0.e0
@@ -247,29 +243,4 @@
       END DO 
 
-      ! Loss of biogenic silicon, Caco3 organic carbon in the sediments. 
-      ! First, the total loss is computed.
-      ! The factor for calcite comes from the alkalinity effect
-      ! -------------------------------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            IF( tmask(ji,jj,1) == 1 ) THEN
-               ikt = mbkt(ji,jj) 
-# if defined key_kriest
-               zwork1(ji,jj) = trb(ji,jj,ikt,jpgsi) * zwscal (ji,jj)
-               zwork2(ji,jj) = trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj)
-# else
-               zwork1(ji,jj) = trb(ji,jj,ikt,jpgsi) * zwsbio4(ji,jj)
-               zwork2(ji,jj) = trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj) + trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) 
-# endif
-               ! For calcite, burial efficiency is made a function of saturation
-               zfactcal      = MIN( excess(ji,jj,ikt), 0.2 )
-               zfactcal      = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) )
-               zwork3(ji,jj) = trb(ji,jj,ikt,jpcal) * zwscal(ji,jj) * 2.e0 * zfactcal
-            ENDIF
-         END DO
-      END DO
-      zsumsedsi  = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * r1_rday
-      zsumsedpo4 = glob_sum( zwork2(:,:) * e1e2t(:,:) ) * r1_rday
-      zsumsedcal = glob_sum( zwork3(:,:) * e1e2t(:,:) ) * r1_rday
 #endif
 
@@ -278,5 +249,5 @@
       ! ------------------------------------------------------
 #if ! defined key_sed
-      zrivsil =  1._wp - ( sumdepsi + rivdsiinput * r1_ryyss ) / ( zsumsedsi + rtrn )
+      zrivsil =  1._wp - sedsilfrac
 #endif
 
@@ -298,7 +269,10 @@
 #if ! defined key_sed
             tra(ji,jj,ikt,jpsil) = tra(ji,jj,ikt,jpsil) + zsiloss * zrivsil 
+            ! Loss of biogenic silicon, Caco3 organic carbon in the sediments. 
+            ! The factor for calcite comes from the alkalinity effect
+            ! -------------------------------------------------------------
             zfactcal = MIN( excess(ji,jj,ikt), 0.2 )
             zfactcal = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) )
-            zrivalk  =  1._wp - ( rivalkinput * r1_ryyss ) * zfactcal / ( zsumsedcal + rtrn )
+            zrivalk  =  sedcalfrac * zfactcal
             tra(ji,jj,ikt,jptal) =  tra(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0
             tra(ji,jj,ikt,jpdic) =  tra(ji,jj,ikt,jpdic) + zcaloss * zrivalk
@@ -394,9 +368,11 @@
             IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation 
             IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated )
-               zwork1(:,:) = 0.
+               CALL wrk_alloc( jpi, jpj, zwork )
+               zwork(:,:) = 0.
                DO jk = 1, jpkm1
-                 zwork1(:,:) = zwork1(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * fse3t(:,:,jk) * tmask(:,:,jk)
+                 zwork(:,:) = zwork(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * fse3t(:,:,jk) * tmask(:,:,jk)
                ENDDO
-               CALL iom_put( "INTNFIX" , zwork1 ) 
+               CALL iom_put( "INTNFIX", zwork ) 
+               CALL wrk_dealloc( jpi, jpj, zwork )
             ENDIF
             IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact )
@@ -418,5 +394,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi, jpj, zdenit2d, zwork1, zwork2, zwork3, zbureff )
+      CALL wrk_dealloc( jpi, jpj, zdenit2d, zbureff )
       CALL wrk_dealloc( jpi, jpj, zsedcal , zsedsi, zsedc )
       CALL wrk_dealloc( jpi, jpj, zwsbio3, zwsbio4, zwscal )
