Index: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/lib_fortran.F90
===================================================================
--- branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/lib_fortran.F90	(revision 3115)
+++ branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/lib_fortran.F90	(revision 3289)
@@ -47,5 +47,5 @@
 
 #if ! defined key_mpp_rep
-   FUNCTION glob_sum_2d( ptab ) RESULT( glob_sum )
+   FUNCTION glob_sum_2d( ptab ) 
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_2D  ***
@@ -53,15 +53,15 @@
       !! ** Purpose : perform a masked sum on the inner global domain of a 2D array
       !!-----------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptab       ! input 2D array
-      REAL(wp)                             ::   glob_sum   ! global masked sum
-      !!-----------------------------------------------------------------------
-      !
-      glob_sum = SUM( ptab(:,:)*tmask_i(:,:) )
-      IF( lk_mpp )   CALL mpp_sum( glob_sum )
+      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptab          ! input 2D array
+      REAL(wp)                             ::   glob_sum_2d   ! global masked sum
+      !!-----------------------------------------------------------------------
+      !
+      glob_sum_2d = SUM( ptab(:,:)*tmask_i(:,:) )
+      IF( lk_mpp )   CALL mpp_sum( glob_sum_2d )
       !
    END FUNCTION glob_sum_2d
    
    
-   FUNCTION glob_sum_3d( ptab ) RESULT( glob_sum )
+   FUNCTION glob_sum_3d( ptab ) 
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_3D  ***
@@ -69,20 +69,20 @@
       !! ** Purpose : perform a masked sum on the inner global domain of a 3D array
       !!-----------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   ptab       ! input 3D array
-      REAL(wp)                               ::   glob_sum   ! global masked sum
+      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   ptab          ! input 3D array
+      REAL(wp)                               ::   glob_sum_3d   ! global masked sum
       !!
       INTEGER :: jk
       !!-----------------------------------------------------------------------
       !
-      glob_sum = 0.e0
+      glob_sum_3d = 0.e0
       DO jk = 1, jpk
-         glob_sum = glob_sum + SUM( ptab(:,:,jk)*tmask_i(:,:) )
-      END DO
-      IF( lk_mpp )   CALL mpp_sum( glob_sum )
+         glob_sum_3d = glob_sum_3d + SUM( ptab(:,:,jk)*tmask_i(:,:) )
+      END DO
+      IF( lk_mpp )   CALL mpp_sum( glob_sum_3d )
       !
    END FUNCTION glob_sum_3d
 
 
-   FUNCTION glob_sum_2d_a( ptab1, ptab2 ) RESULT( glob_sum )
+   FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_2D _a ***
@@ -90,16 +90,16 @@
       !! ** Purpose : perform a masked sum on the inner global domain of two 2D array
       !!-----------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptab1, ptab2   ! input 2D array
-      REAL(wp)            , DIMENSION(2)   ::   glob_sum       ! global masked sum
+      REAL(wp), INTENT(in), DIMENSION(:,:) ::   ptab1, ptab2    ! input 2D array
+      REAL(wp)            , DIMENSION(2)   ::   glob_sum_2d_a   ! global masked sum
       !!-----------------------------------------------------------------------
       !             
-      glob_sum(1) = SUM( ptab1(:,:)*tmask_i(:,:) )
-      glob_sum(2) = SUM( ptab2(:,:)*tmask_i(:,:) )
-      IF( lk_mpp )   CALL mpp_sum( glob_sum, 2 )
+      glob_sum_2d_a(1) = SUM( ptab1(:,:)*tmask_i(:,:) )
+      glob_sum_2d_a(2) = SUM( ptab2(:,:)*tmask_i(:,:) )
+      IF( lk_mpp )   CALL mpp_sum( glob_sum_2d_a, 2 )
       !
    END FUNCTION glob_sum_2d_a
  
  
-   FUNCTION glob_sum_3d_a( ptab1, ptab2 ) RESULT( glob_sum )
+   FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_3D_a ***
@@ -107,16 +107,16 @@
       !! ** Purpose : perform a masked sum on the inner global domain of two 3D array
       !!-----------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   ptab1, ptab2   ! input 3D array
-      REAL(wp)            , DIMENSION(2)     ::   glob_sum       ! global masked sum
+      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   ptab1, ptab2    ! input 3D array
+      REAL(wp)            , DIMENSION(2)     ::   glob_sum_3d_a   ! global masked sum
       !!
       INTEGER :: jk
       !!-----------------------------------------------------------------------
       !
-      glob_sum(:) = 0.e0
+      glob_sum_3d_a(:) = 0.e0
       DO jk = 1, jpk
-         glob_sum(1) = glob_sum(1) + SUM( ptab1(:,:,jk)*tmask_i(:,:) )
-         glob_sum(2) = glob_sum(2) + SUM( ptab2(:,:,jk)*tmask_i(:,:) )
-      END DO
-      IF( lk_mpp )   CALL mpp_sum( glob_sum, 2 )
+         glob_sum_3d_a(1) = glob_sum_3d_a(1) + SUM( ptab1(:,:,jk)*tmask_i(:,:) )
+         glob_sum_3d_a(2) = glob_sum_3d_a(2) + SUM( ptab2(:,:,jk)*tmask_i(:,:) )
+      END DO
+      IF( lk_mpp )   CALL mpp_sum( glob_sum_3d_a, 2 )
       !
    END FUNCTION glob_sum_3d_a
@@ -127,5 +127,5 @@
    !!----------------------------------------------------------------------
    
-   FUNCTION glob_sum_2d( ptab ) RESULT( glob_sum )
+   FUNCTION glob_sum_2d( ptab ) 
       !!----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_2d ***
@@ -134,5 +134,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   ptab
-      REAL(wp)                                 ::   glob_sum   ! global masked sum
+      REAL(wp)                                 ::   glob_sum_2d   ! global masked sum
       !!
       COMPLEX(wp)::   ctmp
@@ -150,10 +150,10 @@
       END DO
       IF( lk_mpp )   CALL mpp_sum( ctmp )   ! sum over the global domain
-      glob_sum = REAL(ctmp,wp)
+      glob_sum_2d = REAL(ctmp,wp)
       !
    END FUNCTION glob_sum_2d   
 
 
-   FUNCTION glob_sum_3d( ptab ) RESULT( glob_sum )
+   FUNCTION glob_sum_3d( ptab ) 
       !!----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_3d ***
@@ -162,5 +162,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) ::   ptab
-      REAL(wp)                                     ::   glob_sum   ! global masked sum
+      REAL(wp)                                     ::   glob_sum_3d   ! global masked sum
       !!
       COMPLEX(wp)::   ctmp
@@ -180,10 +180,10 @@
       END DO
       IF( lk_mpp )   CALL mpp_sum( ctmp )   ! sum over the global domain
-      glob_sum = REAL(ctmp,wp)
+      glob_sum_3d = REAL(ctmp,wp)
       !
    END FUNCTION glob_sum_3d   
 
 
-   FUNCTION glob_sum_2d_a( ptab1, ptab2 ) RESULT( glob_sum )
+   FUNCTION glob_sum_2d_a( ptab1, ptab2 ) 
       !!----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_2d_a ***
@@ -192,5 +192,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   ptab1, ptab2
-      REAL(wp)                                 ::   glob_sum   ! global masked sum
+      REAL(wp)                                 ::   glob_sum_2d_a   ! global masked sum
       !!
       COMPLEX(wp)::   ctmp
@@ -210,10 +210,10 @@
       END DO
       IF( lk_mpp )   CALL mpp_sum( ctmp )   ! sum over the global domain
-      glob_sum = REAL(ctmp,wp)
+      glob_sum_2d_a = REAL(ctmp,wp)
       !
    END FUNCTION glob_sum_2d_a   
 
 
-   FUNCTION glob_sum_3d_a( ptab1, ptab2 ) RESULT( glob_sum )
+   FUNCTION glob_sum_3d_a( ptab1, ptab2 ) 
       !!----------------------------------------------------------------------
       !!                  ***  FUNCTION  glob_sum_3d_a ***
@@ -222,5 +222,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) ::   ptab1, ptab2
-      REAL(wp)                                     ::   glob_sum   ! global masked sum
+      REAL(wp)                                     ::   glob_sum_3d_a   ! global masked sum
       !!
       COMPLEX(wp)::   ctmp
@@ -242,5 +242,5 @@
       END DO
       IF( lk_mpp )   CALL mpp_sum( ctmp )   ! sum over the global domain
-      glob_sum = REAL(ctmp,wp)
+      glob_sum_3d_a = REAL(ctmp,wp)
       !
    END FUNCTION glob_sum_3d_a   
