Index: trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 7646)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 7698)
@@ -89,5 +89,10 @@
          CALL wrk_alloc( jpi , jpj , jpk        , zrhd      , zrhop    )
          CALL wrk_alloc( jpi , jpj , jpk , jpts , ztsn                 )
-         zarea_ssh(:,:) = area(:,:) * sshn(:,:)
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zarea_ssh(ji,jj) = area(ji,jj) * sshn(ji,jj)
+            END DO
+         END DO
       ENDIF
       !
@@ -106,14 +111,34 @@
       IF( iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' )  ) THEN    
          !                     
-         ztsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem)                    ! thermosteric ssh
-         ztsn(:,:,:,jp_sal) = sn0(:,:,:)
+!$OMP PARALLEL DO schedule(static) private(jk, jj, ji)
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ztsn(ji,jj,jk,jp_tem) = tsn(ji,jj,jk,jp_tem)                    ! thermosteric ssh
+                  ztsn(ji,jj,jk,jp_sal) = sn0(ji,jj,jk)
+               END DO
+            END DO
+         END DO
          CALL eos( ztsn, zrhd, gdept_n(:,:,:) )                       ! now in situ density using initial salinity
          !
-         zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
+!$OMP PARALLEL
+!$OMP DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zbotpres(ji,jj) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
+            END DO
+         END DO
          DO jk = 1, jpkm1
-            zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
-         END DO
+!$OMP DO schedule(static) private(jj, ji)
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zbotpres(ji,jj) = zbotpres(ji,jj) + e3t_n(ji,jj,jk) * zrhd(ji,jj,jk)
+               END DO
+            END DO
+         END DO
+!$OMP END PARALLEL
          IF( ln_linssh ) THEN
             IF( ln_isfcav ) THEN
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
                DO ji = 1, jpi
                   DO jj = 1, jpj
@@ -122,5 +147,10 @@
                END DO
             ELSE
-               zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
+               DO ji = 1, jpi
+                  DO jj = 1, jpj
+                     zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,1)
+                  END DO
+               END DO
             END IF
 !!gm
@@ -128,6 +158,7 @@
 !!gm
          END IF
+         !
+         zarho = SUM( area(:,:) * zbotpres(:,:) )
          !                                         
-         zarho = SUM( area(:,:) * zbotpres(:,:) ) 
          IF( lk_mpp )   CALL mpp_sum( zarho )
          zssh_steric = - zarho / area_tot
@@ -136,13 +167,30 @@
          !                                         ! steric sea surface height
          CALL eos( tsn, zrhd, zrhop, gdept_n(:,:,:) )                 ! now in situ and potential density
-         zrhop(:,:,jpk) = 0._wp
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zrhop(ji,jj,jpk) = 0._wp
+            END DO
+         END DO
          CALL iom_put( 'rhop', zrhop )
          !
-         zbotpres(:,:) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
+!$OMP PARALLEL
+!$OMP DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zbotpres(ji,jj) = 0._wp                        ! no atmospheric surface pressure, levitating sea-ice
+            END DO
+         END DO
          DO jk = 1, jpkm1
-            zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
+!$OMP DO schedule(static) private(jj, ji)
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zbotpres(ji,jj) = zbotpres(ji,jj) + e3t_n(ji,jj,jk) * zrhd(ji,jj,jk)
+               END DO
+            END DO
          END DO
          IF( ln_linssh ) THEN
             IF ( ln_isfcav ) THEN
+!$OMP DO schedule(static) private(jj, ji)
                DO ji = 1,jpi
                   DO jj = 1,jpj
@@ -151,9 +199,15 @@
                END DO
             ELSE
-               zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
+!$OMP DO schedule(static) private(jj, ji)
+               DO jj = 1, jpj
+                  DO ji = 1, jpi
+                     zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,1)
+                  END DO
+               END DO
             END IF
          END IF
+!$OMP END PARALLEL
          !    
-         zarho = SUM( area(:,:) * zbotpres(:,:) ) 
+         zarho = SUM( area(:,:) * zbotpres(:,:) )
          IF( lk_mpp )   CALL mpp_sum( zarho )
          zssh_steric = - zarho / area_tot
@@ -162,5 +216,10 @@
          !                                         ! ocean bottom pressure
          zztmp = rau0 * grav * 1.e-4_wp               ! recover pressure from pressure anomaly and cover to dbar = 1.e4 Pa
-         zbotpres(:,:) = zztmp * ( zbotpres(:,:) + sshn(:,:) + thick0(:,:) )
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               zbotpres(ji,jj) = zztmp * ( zbotpres(ji,jj) + sshn(ji,jj) + thick0(ji,jj) )
+            END DO
+         END DO
          CALL iom_put( 'botpres', zbotpres )
          !
@@ -213,6 +272,12 @@
       ! work is not being done against stratification
           CALL wrk_alloc( jpi, jpj, zpe )
-          zpe(:,:) = 0._wp
+!$OMP PARALLEL DO schedule(static) private(jj,ji)
+          DO jj = 1, jpj
+             DO ji = 1, jpi
+                zpe(ji,jj) = 0._wp
+             END DO
+          END DO
           IF( lk_zdfddm ) THEN
+!$OMP PARALLEL DO schedule(static) private(ji,jj,jk,zrw,zaw,zbw)
              DO ji=1,jpi
                 DO jj=1,jpj
@@ -232,4 +297,5 @@
              ENDDO
           ELSE
+!$OMP PARALLEL DO schedule(static) private(ji,jj,jk)
              DO ji = 1, jpi
                 DO jj = 1, jpj
@@ -323,5 +389,5 @@
       INTEGER  ::   ik
       INTEGER  ::   ji, jj, jk  ! dummy loop indices
-      REAL(wp) ::   zztmp  
+      REAL(wp) ::   zztmp, zsum 
       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zsaldta   ! Jan/Dec levitus salinity
       !
@@ -341,14 +407,37 @@
          IF( dia_ar5_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' )
 
-         area(:,:) = e1e2t(:,:) * tmask_i(:,:)
+!$OMP PARALLEL DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               area(ji,jj) = e1e2t(ji,jj) * tmask_i(ji,jj)
+            END DO
+         END DO
 
          area_tot = SUM( area(:,:) )   ;   IF( lk_mpp )   CALL mpp_sum( area_tot )
 
          vol0        = 0._wp
-         thick0(:,:) = 0._wp
+!$OMP PARALLEL
+!$OMP DO schedule(static) private(jj, ji)
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               thick0(ji,jj) = 0._wp
+            END DO
+         END DO
          DO jk = 1, jpkm1
-            vol0        = vol0        + SUM( area (:,:) * tmask(:,:,jk) * e3t_0(:,:,jk) )
-            thick0(:,:) = thick0(:,:) +    tmask_i(:,:) * tmask(:,:,jk) * e3t_0(:,:,jk)
-         END DO
+!$OMP DO schedule(static) private(jj, ji, zsum)
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zsum = area (ji,jj) * tmask(ji,jj,jk) * e3t_0(ji,jj,jk)
+               END DO
+            END DO
+            vol0        = vol0        + zsum
+!$OMP DO schedule(static) private(jj, ji)
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  thick0(ji,jj) = thick0(ji,jj) + tmask_i(ji,jj) * tmask(ji,jj,jk) * e3t_0(ji,jj,jk)
+               END DO
+            END DO
+         END DO
+!$OMP END PARALLEL
          IF( lk_mpp )   CALL mpp_sum( vol0 )
 
@@ -358,7 +447,16 @@
          CALL iom_close( inum )
 
-         sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )        
-         sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:)
+!$OMP PARALLEL
+!$OMP DO schedule(static) private(jk, jj, ji)
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  sn0(ji,jj,jk) = 0.5_wp * ( zsaldta(ji,jj,jk,1) + zsaldta(ji,jj,jk,2) )        
+                  sn0(ji,jj,jk) = sn0(ji,jj,jk) * tmask(ji,jj,jk)
+               END DO
+            END DO
+         END DO
          IF( ln_zps ) THEN               ! z-coord. partial steps
+!$OMP DO schedule(static) private(jj, ji, ik, zztmp)
             DO jj = 1, jpj               ! interpolation of salinity at the last ocean level (i.e. the partial step)
                DO ji = 1, jpi
@@ -371,4 +469,5 @@
             END DO
          ENDIF
+!$OMP END PARALLEL
          !
          CALL wrk_dealloc( jpi , jpj , jpk, jpts, zsaldta )
