Index: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90
===================================================================
--- trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 7698)
+++ trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90	(revision 7753)
@@ -84,40 +84,13 @@
       !     Initialisation of variables used to compute PAR
       !     -----------------------------------------------
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jk,jj,ji)
-      DO jk = 1, jpk
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               ze1(ji,jj,jk) = 0._wp
-               ze2(ji,jj,jk) = 0._wp
-               ze3(ji,jj,jk) = 0._wp
-            END DO
-         END DO
-      END DO
-!$OMP END DO NOWAIT
+      ze1(:,:,:) = 0._wp
+      ze2(:,:,:) = 0._wp
+      ze3(:,:,:) = 0._wp
       !
       !                                        !* attenuation coef. function of Chlorophyll and wavelength (Red-Green-Blue)
                                                !  --------------------------------------------------------
-!$OMP DO schedule(static) private(jk,jj,ji)
-      DO jk = 1, jpk
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zchl3d(ji,jj,jk) = trb(ji,jj,jk,jpnch) + trb(ji,jj,jk,jpdch)
-            END DO
-         END DO
-      END DO
-!$OMP END PARALLEL
-      IF( ln_p5z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zchl3d(ji,jj,jk) = zchl3d(ji,jj,jk) + trb(ji,jj,jk,jppch)
-               END DO
-            END DO
-         END DO
-      END IF
-      !
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji,zchl,irgb)
+                    zchl3d(:,:,:) = trb(:,:,:,jpnch) + trb(:,:,:,jpdch)
+      IF( ln_p5z )  zchl3d(:,:,:) = zchl3d(:,:,:) + trb(:,:,:,jppch)
+      !
       DO jk = 1, jpkm1   
          DO jj = 1, jpj
@@ -137,91 +110,44 @@
       IF( l_trcdm2dc ) THEN                     !  diurnal cycle
          !
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zqsr_corr(ji,jj) = qsr_mean(ji,jj) / ( 1. - fr_i(ji,jj) + rtrn )
-            END DO
-         END DO
+         zqsr_corr(:,:) = qsr_mean(:,:) / ( 1. - fr_i(:,:) + rtrn )
          !
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100 ) 
          !
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
          DO jk = 1, nksrp      
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot_ndcy(ji,jj,jk) =        ze1(ji,jj,jk) +        ze2(ji,jj,jk) +       ze3(ji,jj,jk)
-                  enano    (ji,jj,jk) =  2.1 * ze1(ji,jj,jk) + 0.42 * ze2(ji,jj,jk) + 0.4 * ze3(ji,jj,jk)
-                  ediat    (ji,jj,jk) =  1.6 * ze1(ji,jj,jk) + 0.69 * ze2(ji,jj,jk) + 0.7 * ze3(ji,jj,jk)
-               END DO
-            END DO
+            etot_ndcy(:,:,jk) =        ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
+            enano    (:,:,jk) =  2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
+            ediat    (:,:,jk) =  1.6 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.7 * ze3(:,:,jk)
          END DO
          IF( ln_p5z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
             DO jk = 1, nksrp      
-               DO jj = 1, jpj
-                  DO ji = 1, jpi
-                     epico  (ji,jj,jk) =  2.1 * ze1(ji,jj,jk) + 0.42 * ze2(ji,jj,jk) + 0.4 * ze3(ji,jj,jk)
-                  END DO
-               END DO
+              epico  (:,:,jk) =  2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
             END DO
          ENDIF
          !
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zqsr_corr(ji,jj) = qsr(ji,jj) / ( 1. - fr_i(ji,jj) + rtrn )
-            END DO
-         END DO
+         zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn )
          !
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) 
          !
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
          DO jk = 1, nksrp      
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot(ji,jj,jk) =  ze1(ji,jj,jk) + ze2(ji,jj,jk) + ze3(ji,jj,jk)
-               END DO
-            END DO
+            etot(:,:,jk) =  ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk)
          END DO
          !
       ELSE
          !
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zqsr_corr(ji,jj) = qsr(ji,jj) / ( 1. - fr_i(ji,jj) + rtrn )
-            END DO
-         END DO
+         zqsr_corr(:,:) = qsr(:,:) / ( 1. - fr_i(:,:) + rtrn )
          !
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100  ) 
          !
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, nksrp
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot (ji,jj,jk) =        ze1(ji,jj,jk) +        ze2(ji,jj,jk) +       ze3(ji,jj,jk)
-                  enano(ji,jj,jk) =  2.1 * ze1(ji,jj,jk) + 0.42 * ze2(ji,jj,jk) + 0.4 * ze3(ji,jj,jk)
-                  ediat(ji,jj,jk) =  1.6 * ze1(ji,jj,jk) + 0.69 * ze2(ji,jj,jk) + 0.7 * ze3(ji,jj,jk)
-               END DO
-            END DO
+         DO jk = 1, nksrp      
+            etot (:,:,jk) =        ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
+            enano(:,:,jk) =  2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
+            ediat(:,:,jk) =  1.6 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.7 * ze3(:,:,jk)
          END DO
          IF( ln_p5z ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-            DO jk = 1, nksrp
-               DO jj = 1, jpj
-                  DO ji = 1, jpi
-                     epico(ji,jj,jk) =  2.1 * ze1(ji,jj,jk) + 0.42 * ze2(ji,jj,jk) + 0.4 * ze3(ji,jj,jk)
-                  END DO
-               END DO
+            DO jk = 1, nksrp      
+              epico(:,:,jk) =  2.1 * ze1(:,:,jk) + 0.42 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
             END DO
          ENDIF
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot_ndcy(ji,jj,jk) =  etot(ji,jj,jk)
-               END DO
-            END DO
-         END DO
+         etot_ndcy(:,:,:) =  etot(:,:,:) 
       ENDIF
 
@@ -231,36 +157,16 @@
          CALL p4z_opt_par( kt, qsr, ze1, ze2, ze3, pe0=ze0 )
          !
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               etot3(ji,jj,1) =  qsr(ji,jj) * tmask(ji,jj,1)
-            END DO
-         END DO
-!$OMP DO schedule(static) private(jk,jj,ji)
+         etot3(:,:,1) =  qsr(:,:) * tmask(:,:,1)
          DO jk = 2, nksrp + 1
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot3(ji,jj,jk) =  ( ze0(ji,jj,jk) + ze1(ji,jj,jk) + ze2(ji,jj,jk) + ze3(ji,jj,jk) ) * tmask(ji,jj,jk)
-               END DO
-            END DO
-         END DO
-!$OMP END PARALLEL
+            etot3(:,:,jk) =  ( ze0(:,:,jk) + ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) ) * tmask(:,:,jk)
+         END DO
          !                                     !  ------------------------
       ENDIF
       !                                        !* Euphotic depth and level
-                                               !  ------------------------
-!$OMP PARALLEL 
-!$OMP DO schedule(static) private(jj,ji)
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            neln(ji,jj) = 1
-            heup   (ji,jj) = gdepw_n(ji,jj,2)
-            heup_01(ji,jj) = gdepw_n(ji,jj,2)
-         END DO
-      END DO
+      neln   (:,:) = 1                            !  ------------------------
+      heup   (:,:) = gdepw_n(:,:,2)
+      heup_01(:,:) = gdepw_n(:,:,2)
 
       DO jk = 2, nksrp
-!$OMP DO schedule(static) private(jj,ji)
          DO jj = 1, jpj
            DO ji = 1, jpi
@@ -277,20 +183,14 @@
       END DO
       !
-!$OMP DO schedule(static) private(jj,ji)
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            heup   (ji,jj) = MIN( 300., heup   (ji,jj) )
-            heup_01(ji,jj) = MIN( 300., heup_01(ji,jj) )
-            !                                          !* mean light over the mixed layer
-            zdepmoy(ji,jj)   = 0.e0                    !  -------------------------------
-            zetmp1 (ji,jj)   = 0.e0
-            zetmp2 (ji,jj)   = 0.e0
-            zetmp3 (ji,jj)   = 0.e0
-            zetmp4 (ji,jj)   = 0.e0
-        END DO
-      END DO
+      heup   (:,:) = MIN( 300., heup   (:,:) )
+      heup_01(:,:) = MIN( 300., heup_01(:,:) )
+      !                                        !* mean light over the mixed layer
+      zdepmoy(:,:)   = 0.e0                    !  -------------------------------
+      zetmp1 (:,:)   = 0.e0
+      zetmp2 (:,:)   = 0.e0
+      zetmp3 (:,:)   = 0.e0
+      zetmp4 (:,:)   = 0.e0
 
       DO jk = 1, nksrp
-!$OMP DO schedule(static) private(jj,ji)
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -306,15 +206,7 @@
       END DO
       !
-!$OMP DO schedule(static) private(jk,jj,ji)
-      DO jk = 1, jpk
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               emoy(ji,jj,jk) = etot(ji,jj,jk)       ! remineralisation
-               zpar(ji,jj,jk) = etot_ndcy(ji,jj,jk)  ! diagnostic : PAR with no diurnal cycle 
-            END DO
-         END DO
-      END DO
-      !
-!$OMP DO schedule(static) private(jk,jj,ji,z1_dep)
+      emoy(:,:,:) = etot(:,:,:)       ! remineralisation
+      zpar(:,:,:) = etot_ndcy(:,:,:)  ! diagnostic : PAR with no diurnal cycle 
+      !
       DO jk = 1, nksrp
          DO jj = 1, jpj
@@ -330,16 +222,8 @@
          END DO
       END DO
-!$OMP END PARALLEL
       !
       IF( ln_p5z ) THEN
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zetmp5 (ji,jj) = 0.e0
-            END DO
-         END DO
+         zetmp5 (:,:) = 0.e0
          DO jk = 1, nksrp
-!$OMP DO schedule(static) private(jj,ji,z1_dep)
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -352,5 +236,4 @@
             END DO
          END DO
-!$OMP END PARALLEL
       ENDIF
       IF( lk_iomput ) THEN
@@ -391,45 +274,19 @@
 
       !  Real shortwave
-      IF( ln_varpar ) THEN
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zqsr(ji,jj) = par_varsw(ji,jj) * pqsr(ji,jj)
-            END DO
-         END DO
-      ELSE
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zqsr(ji,jj) = xparsw         * pqsr(ji,jj)
-            END DO
-         END DO
+      IF( ln_varpar ) THEN  ;  zqsr(:,:) = par_varsw(:,:) * pqsr(:,:)
+      ELSE                  ;  zqsr(:,:) = xparsw         * pqsr(:,:)
       ENDIF
       
       !  Light at the euphotic depth 
-      IF( PRESENT( pqsr100 ) ) THEN
-!$OMP PARALLEL DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               pqsr100(ji,jj) = 0.01 * 3. * zqsr(ji,jj)
-            END DO
-         END DO
-      ENDIF
+      IF( PRESENT( pqsr100 ) )  pqsr100(:,:) = 0.01 * 3. * zqsr(:,:)
 
       IF( PRESENT( pe0 ) ) THEN     !  W-level
          !
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jj,ji)
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               pe0(ji,jj,1) = pqsr(ji,jj) - 3. * zqsr(ji,jj)    !   ( 1 - 3 * alpha ) * q
-               pe1(ji,jj,1) = zqsr(ji,jj)
-               pe2(ji,jj,1) = zqsr(ji,jj)
-               pe3(ji,jj,1) = zqsr(ji,jj)
-            END DO
-         END DO
+         pe0(:,:,1) = pqsr(:,:) - 3. * zqsr(:,:)    !   ( 1 - 3 * alpha ) * q
+         pe1(:,:,1) = zqsr(:,:)         
+         pe2(:,:,1) = zqsr(:,:)
+         pe3(:,:,1) = zqsr(:,:)
          !
          DO jk = 2, nksrp + 1
-!$OMP DO schedule(static) private(jj,ji)
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -443,20 +300,12 @@
             !
          END DO
-!$OMP END PARALLEL
         !
       ELSE   ! T- level
         !
-!$OMP PARALLEL
-!$OMP DO schedule(static) private(jj,ji)
-        DO jj = 1, jpj
-           DO ji = 1, jpi
-              pe1(ji,jj,1) = zqsr(ji,jj) * EXP( -0.5 * ekb(ji,jj,1) )
-              pe2(ji,jj,1) = zqsr(ji,jj) * EXP( -0.5 * ekg(ji,jj,1) )
-              pe3(ji,jj,1) = zqsr(ji,jj) * EXP( -0.5 * ekr(ji,jj,1) )
-           END DO
-        END DO
+        pe1(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekb(:,:,1) )
+        pe2(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekg(:,:,1) )
+        pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) )
         !
         DO jk = 2, nksrp      
-!$OMP DO schedule(static) private(jj,ji)
            DO jj = 1, jpj
               DO ji = 1, jpi
@@ -467,5 +316,4 @@
            END DO
         END DO    
-!$OMP END PARALLEL
         !
       ENDIF
@@ -521,5 +369,4 @@
       INTEGER :: ierr
       INTEGER :: ios                 ! Local integer output status for namelist read
-      INTEGER    ::   ji, jj, jk     ! dummy loop indices
       REAL(wp), DIMENSION(nbtimes) :: zsteps                 ! times records
       !
@@ -577,39 +424,13 @@
       IF(lwp) WRITE(numout,*) '        level of light extinction = ', nksrp, ' ref depth = ', gdepw_1d(nksrp+1), ' m'
       !
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  ekr      (ji,jj,jk) = 0._wp
-                  ekb      (ji,jj,jk) = 0._wp
-                  ekg      (ji,jj,jk) = 0._wp
-                  etot     (ji,jj,jk) = 0._wp
-                  etot_ndcy(ji,jj,jk) = 0._wp
-                  enano    (ji,jj,jk) = 0._wp
-                  ediat    (ji,jj,jk) = 0._wp
-               END DO
-            END DO
-         END DO
-      IF( ln_qsr_bio ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  etot3    (ji,jj,jk) = 0._wp
-               END DO
-            END DO
-         END DO
-      END IF
-
-      IF( ln_p5z     ) THEN
-!$OMP PARALLEL DO schedule(static) private(jk,jj,ji)
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  epico    (ji,jj,jk) = 0._wp
-               END DO
-            END DO
-         END DO
-      END IF
+                         ekr      (:,:,:) = 0._wp
+                         ekb      (:,:,:) = 0._wp
+                         ekg      (:,:,:) = 0._wp
+                         etot     (:,:,:) = 0._wp
+                         etot_ndcy(:,:,:) = 0._wp
+                         enano    (:,:,:) = 0._wp
+                         ediat    (:,:,:) = 0._wp
+      IF( ln_p5z     )   epico    (:,:,:) = 0._wp
+      IF( ln_qsr_bio )   etot3    (:,:,:) = 0._wp
       ! 
       IF( nn_timing == 1 )  CALL timing_stop('p4z_opt_init')
