Index: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90
===================================================================
--- trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90	(revision 7698)
+++ trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zpoc.F90	(revision 7753)
@@ -89,48 +89,18 @@
       ! Initialisation of temprary arrys
       IF( ln_p4z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zremipoc(ji,jj,jk) = xremip
-                  zremigoc(ji,jj,jk) = xremip
-               END DO
-            END DO
-         END DO
+         zremipoc(:,:,:) = xremip
+         zremigoc(:,:,:) = xremip
       ELSE    ! ln_p5z
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zremipoc(ji,jj,jk) = xremipc
-                  zremigoc(ji,jj,jk) = xremipc
-               END DO
-            END DO
-         END DO
+         zremipoc(:,:,:) = xremipc
+         zremigoc(:,:,:) = xremipc
       ENDIF
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jk, jj, ji)
-      DO jk = 1, jpk
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zorem3  (ji,jj,jk) = 0.
-               orem    (ji,jj,jk) = 0.
-               ztremint(ji,jj,jk) = 0.
-            END DO
-         END DO
+      zorem3(:,:,:)   = 0.
+      orem  (:,:,:)   = 0.
+      ztremint(:,:,:) = 0.
+
+      DO jn = 1, jcpoc
+        alphag(:,:,:,jn) = alphan(jn)
+        alphap(:,:,:,jn) = alphan(jn)
       END DO
-!OMP END DO NOWAIT
-      DO jn = 1, jcpoc
-!$OMP DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  alphag(ji,jj,jk,jn) = alphan(jn)
-                  alphap(ji,jj,jk,jn) = alphan(jn)
-               END DO
-            END DO
-         END DO
-      END DO
-!$OMP END PARALLEL
 
      ! -----------------------------------------------------------------------
@@ -140,5 +110,4 @@
      ! -----------------------------------------------------------------------
      DO jk = 2, jpkm1
-!$OMP PARALLEL DO schedule(static) private(jj,ji,zdep,alphat,remint,zsizek1,zsizek,zpoc,jn)
         DO jj = 1, jpj
            DO ji = 1, jpi
@@ -151,4 +120,7 @@
                 !
                 IF( gdept_n(ji,jj,jk) > zdep ) THEN
+                  alphat = 0.
+                  remint = 0.
+                  !
                   zsizek1  = e3t_n(ji,jj,jk-1) / 2. / (wsbio4(ji,jj,jk-1) + rtrn) * tgfunc(ji,jj,jk-1)
                   zsizek = e3t_n(ji,jj,jk) / 2. / (wsbio4(ji,jj,jk) + rtrn) * tgfunc(ji,jj,jk)
@@ -183,5 +155,6 @@
                        &   + prodgoc(ji,jj,jk) * alphan(jn) / tgfunc(ji,jj,jk) / reminp(jn)             &
                        &   * ( 1. - exp( -reminp(jn) * zsizek ) ) * rday / rfact2 
-
+                       alphat = alphat + alphag(ji,jj,jk,jn)
+                       remint = remint + alphag(ji,jj,jk,jn) * reminp(jn)
                     END DO
                   ELSE
@@ -201,9 +174,8 @@
                        &   - exp( -reminp(jn) * zsizek1 ) ) * exp( -reminp(jn) * zsizek ) + prodgoc(ji,jj,jk) &
                        &   / tgfunc(ji,jj,jk) * ( 1. - exp( -reminp(jn) * zsizek ) ) ) * rday / rfact2 / reminp(jn) 
+                       alphat = alphat + alphag(ji,jj,jk,jn)
+                       remint = remint + alphag(ji,jj,jk,jn) * reminp(jn)
                     END DO
                   ENDIF
-                  !
-                  alphat =  SUM(alphag(ji,jj,jk,:))
-                  remint =  SUM(alphag(ji,jj,jk,:) * reminp(:))
                   !
                   DO jn = 1, jcpoc
@@ -221,26 +193,9 @@
       END DO
 
-      IF( ln_p4z ) THEN   
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zremigoc(ji,jj,jk) = MIN( xremip , ztremint(ji,jj,jk) )
-               END DO
-            END DO
-         END DO
-      ELSE
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zremigoc(ji,jj,jk) = MIN( xremipc, ztremint(ji,jj,jk) )
-               END DO
-            END DO
-         END DO
+      IF( ln_p4z ) THEN   ;  zremigoc(:,:,:) = MIN( xremip , ztremint(:,:,:) )
+      ELSE                ;  zremigoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) )
       ENDIF
 
       IF( ln_p4z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji,zremig,zorem2,zofer2,zofer3)
          DO jk = 1, jpkm1
             DO jj = 1, jpj
@@ -266,5 +221,4 @@
          END DO
       ELSE
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji,zremig,zopoc2,zofer2,zopon2,zopop2)
          DO jk = 1, jpkm1
             DO jj = 1, jpj
@@ -312,18 +266,11 @@
      ! -------------------------------------------------------------------
      !
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jj,ji)
-     DO jj = 1, jpj
-        DO ji = 1, jpi
-           totprod(ji,jj) = 0.
-           totthick(ji,jj) = 0.
-           totcons(ji,jj) = 0.
-        END DO
-     END DO
+     totprod(:,:) = 0.
+     totthick(:,:) = 0.
+     totcons(:,:) = 0.
      ! intregrated production and consumption of POC in the mixed layer
      ! ----------------------------------------------------------------
      ! 
      DO jk = 1, jpkm1
-!$OMP DO schedule(static) private(jj,ji,zdep)
         DO jj = 1, jpj
            DO ji = 1, jpi
@@ -339,10 +286,8 @@
         END DO
      END DO
-!$OMP END PARALLEL
 
      ! Computation of the lability spectrum in the mixed layer. In the mixed 
      ! layer, this spectrum is supposed to be uniform.
      ! ---------------------------------------------------------------------
-!$OMP DO schedule(static) private(jk,jj,ji,zdep,alphat,remint,jn)
      DO jk = 1, jpkm1
         DO jj = 1, jpj
@@ -350,4 +295,6 @@
               IF (tmask(ji,jj,jk) == 1.) THEN
                 zdep = hmld(ji,jj)
+                alphat = 0.0
+                remint = 0.0
                 IF( gdept_n(ji,jj,jk) <= zdep ) THEN
                    DO jn = 1, jcpoc
@@ -356,10 +303,10 @@
                       alphap(ji,jj,jk,jn) = totprod(ji,jj) * alphan(jn) / ( reminp(jn)    &
                       &                     * totthick(ji,jj) + totcons(ji,jj) + wsbio + rtrn )
+                      alphat = alphat + alphap(ji,jj,jk,jn)
                    END DO
-                   alphat =  SUM(alphap(ji,jj,jk,:))
                    DO jn = 1, jcpoc
                       alphap(ji,jj,jk,jn) = alphap(ji,jj,jk,jn) / ( alphat + rtrn)
+                      remint = remint + alphap(ji,jj,jk,jn) * reminp(jn)
                    END DO
-                   remint =  SUM(alphap(ji,jj,jk,:) * reminp(:))
                    ! Mean remineralization rate in the mixed layer
                    ztremint(ji,jj,jk) =  MAX( 0., remint )
@@ -370,22 +317,6 @@
      END DO
      !
-     IF( ln_p4z ) THEN  
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpi
-                 zremipoc(ji,jj,jk) = MIN( xremip , ztremint(ji,jj,jk) )
-              END DO
-           END DO
-        END DO
-     ELSE                
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpi
-                 zremipoc(ji,jj,jk) = MIN( xremipc , ztremint(ji,jj,jk) )
-              END DO
-           END DO
-        END DO
+     IF( ln_p4z ) THEN   ;  zremipoc(:,:,:) = MIN( xremip , ztremint(:,:,:) )
+     ELSE                ;  zremipoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) )
      ENDIF
 
@@ -399,5 +330,4 @@
      !
      DO jk = 2, jpkm1
-!$OMP PARALLEL DO schedule(static) private(jj,ji,zdep,alphat,remint,zsizek1,zsizek,zpoc,jn)
         DO jj = 1, jpj
            DO ji = 1, jpi
@@ -405,4 +335,6 @@
                 zdep = hmld(ji,jj)
                 IF( gdept_n(ji,jj,jk) > zdep ) THEN
+                  alphat = 0.
+                  remint = 0.
                   !
                   ! the scale factors are corrected with temperature
@@ -430,4 +362,5 @@
                        &   * zsizek ) )
                        alphap(ji,jj,jk,jn) = MAX( 0., alphap(ji,jj,jk,jn) )
+                       alphat = alphat + alphap(ji,jj,jk,jn)
                     END DO
                   ELSE
@@ -452,13 +385,13 @@
                        &   - exp( -reminp(jn) * zsizek ) )
                        alphap(ji,jj,jk,jn) = max(0., alphap(ji,jj,jk,jn) )
+                       alphat = alphat + alphap(ji,jj,jk,jn)
                     END DO
                   ENDIF
-                  alphat =  SUM(alphap(ji,jj,jk,:))
                   ! Normalization of the lability spectrum so that the 
                   ! integral is equal to 1
                   DO jn = 1, jcpoc
                      alphap(ji,jj,jk,jn) = alphap(ji,jj,jk,jn) / ( alphat + rtrn)
+                     remint = remint + alphap(ji,jj,jk,jn) * reminp(jn)
                   END DO
-                  remint =  SUM(alphap(ji,jj,jk,:) * reminp(:))
                   ! Mean remineralization rate in the water column
                   ztremint(ji,jj,jk) =  MAX( 0., remint )
@@ -469,26 +402,9 @@
       END DO
 
-     IF( ln_p4z ) THEN  
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpi
-                 zremipoc(ji,jj,jk) = MIN( xremip , ztremint(ji,jj,jk) )
-              END DO
-           END DO
-        END DO
-     ELSE                
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpi
-                 zremipoc(ji,jj,jk) = MIN( xremipc , ztremint(ji,jj,jk) )
-              END DO
-           END DO
-        END DO
+     IF( ln_p4z ) THEN   ;  zremipoc(:,:,:) = MIN( xremip , ztremint(:,:,:) )
+     ELSE                ;  zremipoc(:,:,:) = MIN( xremipc, ztremint(:,:,:) )
      ENDIF
 
      IF( ln_p4z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji,zremip,zorem,zofer)
          DO jk = 1, jpkm1
             DO jj = 1, jpj
@@ -511,5 +427,4 @@
          END DO
      ELSE
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji,zremip,zopoc,zopon,zopop,zofer)
        DO jk = 1, jpkm1
           DO jj = 1, jpj
@@ -572,5 +487,5 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER :: jn, jk, jj, ji
+      INTEGER :: jn
       REAL(wp) :: remindelta, reminup, remindown
       INTEGER  :: ifault
@@ -642,12 +557,5 @@
 
       DO jn = 1, jcpoc
-!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  alphap(ji,jj,jk,jn) = alphan(jn)
-               END DO
-            END DO
-         END DO
+         alphap(:,:,:,jn) = alphan(jn)
       END DO
 
