Index: branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
===================================================================
--- branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 6059)
+++ branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 6060)
@@ -30,13 +30,12 @@
    !!       Original.   May 2012.  (J. Simeon, C. Calone, G. Madec, C. Ethe)
    !!===================================================================
-
    USE dom_oce        ! ocean space and time domain and to get jperio
-   USE wrk_nemo       ! work arrays
    USE crs            ! domain for coarse grid
+   !
    USE in_out_manager 
    USE par_kind
    USE crslbclnk
+   USE wrk_nemo       ! work arrays
    USE lib_mpp
-   
 
    IMPLICIT NONE
@@ -54,10 +53,10 @@
    REAL(wp) :: r_inf = 1e+36
 
-   !! Substitutions
-#  include "domzgr_substitute.h90"
-   
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
-
 
    SUBROUTINE crs_dom_msk
@@ -133,4 +132,5 @@
    END SUBROUTINE crs_dom_msk
 
+
    SUBROUTINE crs_dom_coordinates( p_gphi, p_glam, cd_type, p_gphi_crs, p_glam_crs )
       !!----------------------------------------------------------------
@@ -334,5 +334,5 @@
       !!              cd_type     = grid type (T,U,V,F) for scale factors; for velocities (U or V)
       !!              cd_op       = applied operation (SUM, VOL, WGT)
-      !!              p_fse3      = (Optional) parent grid vertical level thickness (fse3u or fse3v)
+      !!              p_e3      = (Optional) parent grid vertical level thickness (e3u or e3v)
       !! ** Outputs : p_cfield2d_1 = (Optional) 2D field on coarse grid
       !!              p_cfield2d_2 = (Optional) 2D field on coarse grid
@@ -342,32 +342,27 @@
       !! History.     4 Jun.  Write for WGT and scale factors only
       !!----------------------------------------------------------------
-      !! 
-      !!  Arguments
-      CHARACTER(len=1),                         INTENT(in)  :: cd_type  ! grid type U,V 
-      REAL(wp), DIMENSION(jpi,jpj,jpk)        , INTENT(in)  :: p_mask  ! Parent grid U,V mask
-      REAL(wp), DIMENSION(jpi,jpj)            , INTENT(in)  :: p_e1     ! Parent grid U,V scale factors (e1)
-      REAL(wp), DIMENSION(jpi,jpj)            , INTENT(in)  :: p_e2     ! Parent grid U,V scale factors (e2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk)        , INTENT(in)  :: p_e3     ! Parent grid vertical level thickness (fse3u, fse3v)
-
-      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(out) :: p_fld1_crs ! Coarse grid box 3D quantity 
-      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(out) :: p_fld2_crs ! Coarse grid box 3D quantity 
-
-      !! Local variables
-      REAL(wp)                                :: zdAm
-      INTEGER                                 :: ji, jj, jk , ii, ij, je_2
-
-      REAL(wp), DIMENSION(:,:,:), POINTER     :: zvol, zmask      
+      CHARACTER(len=1),                         INTENT(in   ) ::   cd_type    ! grid type U,V 
+      REAL(wp), DIMENSION(jpi,jpj,jpk)        , INTENT(in   ) ::   p_mask     ! Parent grid U,V mask
+      REAL(wp), DIMENSION(jpi,jpj)            , INTENT(in   ) ::   p_e1       ! Parent grid U,V scale factors (e1)
+      REAL(wp), DIMENSION(jpi,jpj)            , INTENT(in   ) ::   p_e2       ! Parent grid U,V scale factors (e2)
+      REAL(wp), DIMENSION(jpi,jpj,jpk)        , INTENT(in   ) ::   p_e3       ! Parent grid vertical level thickness (e3u, e3v)
+      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(  out) ::   p_fld1_crs ! Coarse grid box 3D quantity 
+      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(  out) ::   p_fld2_crs ! Coarse grid box 3D quantity 
+      !
+      INTEGER  ::   ji, jj, jk , ii, ij, je_2
+      REAL(wp) ::   zdAm
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   zvol, zmask      
       !!----------------------------------------------------------------  
-   
-      CALL wrk_alloc( jpi, jpj, jpk, zvol, zmask )
-
-      p_fld1_crs(:,:,:) = 0.0
-      p_fld2_crs(:,:,:) = 0.0
+      !
+      CALL wrk_alloc( jpi,jpj,jpk,   zvol, zmask )
+      !
+      p_fld1_crs(:,:,:) = 0._wp
+      p_fld2_crs(:,:,:) = 0._wp
 
       DO jk = 1, jpk
          zvol(:,:,jk) =  p_e1(:,:) * p_e2(:,:) * p_e3(:,:,jk) 
-      ENDDO
-
-      zmask(:,:,:) = 0.0
+      END DO
+
+      zmask(:,:,:) = 0._wp
       IF( cd_type == 'W' ) THEN
          zmask(:,:,1) = p_mask(:,:,1) 
@@ -469,5 +464,5 @@
       !!              p_pmask     = parent grid mask (T,U,V,F) for scale factors; 
       !!                                       for velocities (U or V)
-      !!              p_fse3      = parent grid vertical level thickness (fse3u or fse3v)
+      !!              p_e3      = parent grid vertical level thickness (e3u or e3v)
       !!              p_pfield    = U or V on the parent grid
       !!              p_surf_crs  = (Optional) Coarse grid weight for averaging
@@ -478,38 +473,33 @@
       !!            5 Jun.  Streamline for area-weighted average only ; separate scale factor and weights.
       !!----------------------------------------------------------------
-      !! 
-      !!  Arguments
-      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in)           :: p_fld   ! T, U, V or W on parent grid
-      CHARACTER(len=3),                         INTENT(in)           :: cd_op    ! Operation SUM, MAX or MIN
+      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in)           :: p_fld      ! T, U, V or W on parent grid
+      CHARACTER(len=3),                         INTENT(in)           :: cd_op      ! Operation SUM, MAX or MIN
       CHARACTER(len=1),                         INTENT(in)           :: cd_type    ! grid type U,V 
-      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in)           :: p_mask    ! Parent grid T,U,V mask
-      REAL(wp), DIMENSION(jpi,jpj),             INTENT(in), OPTIONAL :: p_e12    ! Parent grid T,U,V scale factors (e1 or e2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in), OPTIONAL :: p_e3     ! Parent grid vertical level thickness (fse3u, fse3v)
+      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in)           :: p_mask     ! Parent grid T,U,V mask
+      REAL(wp), DIMENSION(jpi,jpj),             INTENT(in), OPTIONAL :: p_e12      ! Parent grid T,U,V scale factors (e1 or e2)
+      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in), OPTIONAL :: p_e3       ! Parent grid vertical level thickness (e3u, e3v)
       REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_surf_crs ! Coarse grid area-weighting denominator    
-      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_mask_crs    ! Coarse grid T,U,V maska
-      REAL(wp),                                 INTENT(in)           :: psgn    ! sign 
-
-
-      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(out)          :: p_fld_crs ! Coarse grid box 3D quantity 
-
-      !! Local variables
-      INTEGER  :: ji, jj, jk 
-      INTEGER  :: ii, ij, ijie, ijje, je_2
-      REAL(wp) :: zflcrs, zsfcrs   
-      REAL(wp), DIMENSION(:,:,:), POINTER :: zsurf, zsurfmsk, zmask  
+      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_mask_crs ! Coarse grid T,U,V maska
+      REAL(wp),                                 INTENT(in)           :: psgn       ! sign 
+      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(  out)        :: p_fld_crs  ! Coarse grid box 3D quantity 
+      !
+      INTEGER  ::   ji, jj, jk 
+      INTEGER  ::   ii, ij, ijie, ijje, je_2
+      REAL(wp) ::   zflcrs, zsfcrs   
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   zsurf, zsurfmsk, zmask  
       !!----------------------------------------------------------------  
-   
-      p_fld_crs(:,:,:) = 0.0
-
+      !
+      p_fld_crs(:,:,:) = 0._wp
+      !
       SELECT CASE ( cd_op )
-      
-         CASE ( 'VOL' )
-      
-            CALL wrk_alloc( jpi, jpj, jpk, zsurf, zsurfmsk )
-         
-            SELECT CASE ( cd_type )
-            
-               CASE( 'T', 'W' )
-                  IF( cd_type == 'T' ) THEN
+      !
+      CASE ( 'VOL' )
+         !
+         CALL wrk_alloc( jpi,jpj,jpk,   zsurf, zsurfmsk )
+         !   
+         SELECT CASE ( cd_type )
+         !   
+         CASE( 'T', 'W' )
+               IF( cd_type == 'T' ) THEN
                      DO jk = 1, jpk
                         zsurf   (:,:,jk) =  p_e12(:,:) * p_e3(:,:,jk) *  p_mask(:,:,jk) 
@@ -1136,5 +1126,5 @@
       !!              p_pmask     = parent grid mask (T,U,V,F) for scale factors; 
       !!                                       for velocities (U or V)
-      !!              p_fse3      = parent grid vertical level thickness (fse3u or fse3v)
+      !!              p_e3      = parent grid vertical level thickness (e3u or e3v)
       !!              p_pfield    = U or V on the parent grid
       !!              p_surf_crs  = (Optional) Coarse grid weight for averaging
@@ -1145,6 +1135,4 @@
       !!            5 Jun.  Streamline for area-weighted average only ; separate scale factor and weights.
       !!----------------------------------------------------------------
-      !! 
-      !!  Arguments
       REAL(wp), DIMENSION(jpi,jpj),             INTENT(in)           :: p_fld   ! T, U, V or W on parent grid
       CHARACTER(len=3),                         INTENT(in)           :: cd_op    ! Operation SUM, MAX or MIN
@@ -1152,21 +1140,18 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in)           :: p_mask    ! Parent grid T,U,V mask
       REAL(wp), DIMENSION(jpi,jpj),             INTENT(in), OPTIONAL :: p_e12    ! Parent grid T,U,V scale factors (e1 or e2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in), OPTIONAL :: p_e3     ! Parent grid vertical level thickness (fse3u, fse3v)
+      REAL(wp), DIMENSION(jpi,jpj,jpk),         INTENT(in), OPTIONAL :: p_e3     ! Parent grid vertical level thickness (e3u, e3v)
       REAL(wp), DIMENSION(jpi_crs,jpj_crs)    , INTENT(in), OPTIONAL :: p_surf_crs ! Coarse grid area-weighting denominator    
       REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_mask_crs    ! Coarse grid T,U,V mask
       REAL(wp),                                 INTENT(in)           :: psgn   
-
       REAL(wp), DIMENSION(jpi_crs,jpj_crs)    , INTENT(out)          :: p_fld_crs ! Coarse grid box 3D quantity 
-
-      !! Local variables
+      !
       INTEGER  :: ji, jj, jk                 ! dummy loop indices
       INTEGER  :: ijie, ijje, ii, ij, je_2
       REAL(wp) :: zflcrs, zsfcrs   
       REAL(wp), DIMENSION(:,:), POINTER :: zsurfmsk   
-
       !!----------------------------------------------------------------  
-   
-      p_fld_crs(:,:) = 0.0
-
+      !
+      p_fld_crs(:,:) = 0._wp
+      !
       SELECT CASE ( cd_op )
       
