Index: branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 7041)
+++ branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 7068)
@@ -8,8 +8,4 @@
    !!             3.4  !  2011-06 (C. Ethe) USE of fldread
    !!             3.5  !  2012-07 (O. Aumont) improvment of river input of nutrients 
-   !!----------------------------------------------------------------------
-#if defined key_pisces
-   !!----------------------------------------------------------------------
-   !!   'key_pisces'                                       PISCES bio-model
    !!----------------------------------------------------------------------
    !!   p4z_sed        :  Compute loss of organic matter in the sediments
@@ -56,8 +52,6 @@
       INTEGER, INTENT(in) ::   kt, knt ! ocean time step
       INTEGER  ::   ji, jj, jk, ikt
-#if ! defined key_sed
       REAL(wp) ::   zsumsedsi, zsumsedpo4, zsumsedcal
       REAL(wp) ::   zrivalk, zrivsil, zrivno3
-#endif
       REAL(wp) ::  zwflux, zfminus, zfplus
       REAL(wp) ::  zlim, zfact, zfactcal
@@ -205,57 +199,56 @@
       END DO
 
-#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
-         DO ji = 1, jpi
-           IF( tmask(ji,jj,1) == 1 ) THEN
-              ikt = mbkt(ji,jj)
-              zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
-                &     + trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) )  * 1E3 * 1E6 / 1E4
-              zflx  = LOG10( MAX( 1E-3, zflx ) )
-              zo2   = LOG10( MAX( 10. , trb(ji,jj,ikt,jpoxy) * 1E6 ) )
-              zno3  = LOG10( MAX( 1.  , trb(ji,jj,ikt,jpno3) * 1E6 * rno3 ) )
-              zdep  = LOG10( gdepw_n(ji,jj,ikt+1) )
-              zdenit2d(ji,jj) = -2.2567 - 1.185 * zflx - 0.221 * zflx**2 - 0.3995 * zno3 * zo2 + 1.25 * zno3    &
-              &                + 0.4721 * zo2 - 0.0996 * zdep + 0.4256 * zflx * zo2
-              zdenit2d(ji,jj) = 10.0**( zdenit2d(ji,jj) )
-              !
-              zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
-                &     + trb(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.
-      ! 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) 
-               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) 
-               ! 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
+      IF( .NOT.lk_sed ) THEN
+         ! 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
+            DO ji = 1, jpi
+              IF( tmask(ji,jj,1) == 1 ) THEN
+                 ikt = mbkt(ji,jj)
+                 zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
+                   &     + trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) )  * 1E3 * 1E6 / 1E4
+                 zflx  = LOG10( MAX( 1E-3, zflx ) )
+                 zo2   = LOG10( MAX( 10. , trb(ji,jj,ikt,jpoxy) * 1E6 ) )
+                 zno3  = LOG10( MAX( 1.  , trb(ji,jj,ikt,jpno3) * 1E6 * rno3 ) )
+                 zdep  = LOG10( gdepw_n(ji,jj,ikt+1) )
+                 zdenit2d(ji,jj) = -2.2567 - 1.185 * zflx - 0.221 * zflx**2 - 0.3995 * zno3 * zo2 + 1.25 * zno3    &
+                   &                + 0.4721 * zo2 - 0.0996 * zdep + 0.4256 * zflx * zo2
+                   zdenit2d(ji,jj) = 10.0**( zdenit2d(ji,jj) )
+                   !
+                   zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
+                     &     + trb(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.
+           ! 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) 
+                    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) 
+                    ! 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
 
       ! This loss is scaled at each bottom grid cell for equilibrating the total budget of silica in the ocean.
       ! Thus, the amount of silica lost in the sediments equal the supply at the surface (dust+rivers)
       ! ------------------------------------------------------
-#if ! defined key_sed
-      zrivsil =  1._wp - ( sumdepsi + rivdsiinput * r1_ryyss ) / ( zsumsedsi + rtrn )
-#endif
+      IF( .NOT.lk_sed )    zrivsil =  1._wp - ( sumdepsi + rivdsiinput * r1_ryyss ) / ( zsumsedsi + rtrn )
 
       DO jj = 1, jpj
@@ -270,12 +263,12 @@
             tra(ji,jj,ikt,jpgsi) = tra(ji,jj,ikt,jpgsi) - zsiloss
             tra(ji,jj,ikt,jpcal) = tra(ji,jj,ikt,jpcal) - zcaloss
-#if ! defined key_sed
-            tra(ji,jj,ikt,jpsil) = tra(ji,jj,ikt,jpsil) + zsiloss * zrivsil 
-            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 )
-            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
-#endif
+            IF( .NOT.lk_sed ) THEN
+               tra(ji,jj,ikt,jpsil) = tra(ji,jj,ikt,jpsil) + zsiloss * zrivsil 
+               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 )
+               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
+            ENDIF
          END DO
       END DO
@@ -294,20 +287,20 @@
             zwstpoc              = trb(ji,jj,ikt,jpgoc) * zws4 + trb(ji,jj,ikt,jppoc) * zws3
 
-#if ! defined key_sed
-            ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification
-            ! in the sediments and just above the sediments. Not very clever, but simpliest option.
-            zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 )
-            z1pdenit = zwstpoc * zrivno3 - zpdenit
-            zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) )
-            zdenitt = MIN(  0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) )
-            tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt
-            tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt
-            tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt
-            tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt)
-            tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut
-            tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) )
-            tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt
-            sdenit(ji,jj) = rdenit * zpdenit * e3t_n(ji,jj,ikt)
-#endif
+            IF( .NOT.lk_sed ) THEN
+               ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification
+               ! in the sediments and just above the sediments. Not very clever, but simpliest option.
+               zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 )
+               z1pdenit = zwstpoc * zrivno3 - zpdenit
+               zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) )
+               zdenitt = MIN(  0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) )
+               tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt
+               tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt
+               tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt
+               tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt)
+               tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut
+               tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) )
+               tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt
+               sdenit(ji,jj) = rdenit * zpdenit * e3t_n(ji,jj,ikt)
+            ENDIF
          END DO
       END DO
@@ -392,13 +385,4 @@
 
 
-#else
-   !!======================================================================
-   !!  Dummy module :                                   No PISCES bio-model
-   !!======================================================================
-CONTAINS
-   SUBROUTINE p4z_sed                         ! Empty routine
-   END SUBROUTINE p4z_sed
-#endif 
-
    !!======================================================================
 END MODULE p4zsed
