Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OFF_SRC/domrea.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 7217)
@@ -125,5 +125,5 @@
       NAMELIST/namdom/ nn_bathy , rn_bathy, rn_e3zps_min, rn_e3zps_rat, nn_msh    , rn_hmin,   &
          &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin ,            &
-         &             rn_rdtmax, rn_rdth     , nn_baro     , nn_closea , ln_crs, &
+         &             rn_rdtmax, rn_rdth     , nn_baro     , nn_closea , &
          &             jphgr_msh, &
          &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m, &
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90	(revision 7217)
@@ -45,5 +45,5 @@
       NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,   &
          &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin ,                  &
-         &             rn_rdtmax, rn_rdth     , nn_closea , ln_crs,    &
+         &             rn_rdtmax, rn_rdth     , nn_closea , &
          &             jphgr_msh, &
          &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m, &
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90	(revision 7217)
@@ -139,5 +139,4 @@
       INTEGER           :: nn_factx   = 3       !: reduction factor of x-dimension of the parent grid
       INTEGER           :: nn_facty   = 3       !: reduction factor of y-dimension of the parent grid
-      INTEGER           :: nn_binref  = 0       !: 0 = binning starts north fold (equator could be asymmetric)
                                                 !: 1 = binning centers at equator (north fold my have artifacts)     
                                                 !:    for even reduction factors, equator placed in bin biased south
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 7217)
@@ -5,21 +5,6 @@
    !!           higher-resolution grid for the coarse grid.
    !!
-   !!  Method:  Given the user-defined reduction factor, 
-   !!           the averaging bins are set: 
-   !!           - nn_binref = 0, starting from the north 
-   !!           to the south in the model interior domain, 
-   !!           in this way the north fold and redundant halo cells  
-   !!           could be handled in a consistent manner and 
-   !!           the irregularities of bin size can be handled
-   !!           more naturally by the presence of land
-   !!           in the southern boundary.  Thus the southernmost bin 
-   !!           could be of an irregular bin size.
-   !!           Information on the parent grid is retained, specifically,
-   !!           each coarse grid cell's volume and ocean surface 
-   !!           at the faces, relative to the parent grid.
-   !!           - nn_binref = 1 (not yet available), starting
-   !!           at a centralized bin at the equator, being only
-   !!           truly centered for odd-numbered j-direction reduction 
-   !!           factors.
+   !!  Method:
+
    !!  References:  Aumont, O., J.C. Orr, D. Jamous, P. Monfray
    !!               O. Marti and G. Madec, 1998. A degradation 
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 7217)
@@ -99,45 +99,35 @@
 
       !---------------------------------------------------------------------------------------------------
-      !scale factors: swap 
-      !---------------------------------------------------------------------------------------------------
-#if defined key_vvl
-      !e3t_b_crs(:,:,:) = e3t_n_crs(:,:,:)
-      !e3u_b_crs(:,:,:) = e3u_n_crs(:,:,:)
-      !e3v_b_crs(:,:,:) = e3v_n_crs(:,:,:)
-      !e3w_b_crs(:,:,:) = e3w_n_crs(:,:,:)
-      !e3t_n_crs(:,:,:) = e3t_a_crs(:,:,:)
-      !e3u_n_crs(:,:,:) = e3u_a_crs(:,:,:)
-      !e3v_n_crs(:,:,:) = e3v_a_crs(:,:,:)
-      !e3w_n_crs(:,:,:) = e3w_a_crs(:,:,:)
+      !scale factors: before and now 
+      !---------------------------------------------------------------------------------------------------
+#if defined key_vvl
  
-      !cbr: ds dynnxt, si  (lk_dynspg_ts.AND.ln_bt_fw) on fait un swap simple ( e3X_b_crs=e3X_n_crs )
-      !                 sinon e3X_b_crs passe par le filtre d'asselin !!!!!!
-      !     ds dommvl, swap simple pr  e3X_n_crs=e3X_a_crs 
-
 
       IF( kt /= nit000 )THEN
-      zfse3t(:,:,:) = e3t_b(:,:,:)
-      zfse3u(:,:,:) = e3u_b(:,:,:)
-      zfse3v(:,:,:) = e3v_b(:,:,:)
-      zfse3w(:,:,:) = e3w_b(:,:,:)
-      CALL crs_dom_e3( e1t, e2t, zfse3t, p_sfc_3d_crs=e1e2w_crs, cd_type='T', p_mask=tmask, p_e3_crs=e3t_b_crs, p_e3_max_crs=zs_crs)
-      CALL crs_dom_e3( e1t, e2t, zfse3w, p_sfc_3d_crs=e1e2w_crs, cd_type='W', p_mask=tmask, p_e3_crs=e3w_b_crs, p_e3_max_crs=zs_crs)
-      CALL crs_dom_e3( e1u, e2u, zfse3u, p_sfc_2d_crs=e2u_crs  , cd_type='U', p_mask=umask, p_e3_crs=e3u_b_crs, p_e3_max_crs=zs_crs)
-      CALL crs_dom_e3( e1v, e2v, zfse3v, p_sfc_2d_crs=e1v_crs  , cd_type='V', p_mask=vmask, p_e3_crs=e3v_b_crs, p_e3_max_crs=zs_crs)
-      DO jk = 1, jpk
-         DO ji = 1, jpi_crs
-            DO jj = 1, jpj_crs
-               IF( e3t_b_crs(ji,jj,jk) == 0._wp ) e3t_b_crs(ji,jj,jk) = e3t_1d(jk)
-               IF( e3w_b_crs(ji,jj,jk) == 0._wp ) e3w_b_crs(ji,jj,jk) = e3w_1d(jk)
-               IF( e3u_b_crs(ji,jj,jk) == 0._wp ) e3u_b_crs(ji,jj,jk) = e3t_1d(jk)
-               IF( e3v_b_crs(ji,jj,jk) == 0._wp ) e3v_b_crs(ji,jj,jk) = e3t_1d(jk)
+         zfse3t(:,:,:) = e3t_b(:,:,:)
+         zfse3u(:,:,:) = e3u_b(:,:,:)
+         zfse3v(:,:,:) = e3v_b(:,:,:)
+         zfse3w(:,:,:) = e3w_b(:,:,:)
+
+         CALL crs_dom_e3( e1t, e2t, zfse3t, p_sfc_3d_crs=e1e2w_crs, cd_type='T', p_mask=tmask, p_e3_crs=e3t_b_crs, p_e3_max_crs=zs_crs)
+         CALL crs_dom_e3( e1t, e2t, zfse3w, p_sfc_3d_crs=e1e2w_crs, cd_type='W', p_mask=tmask, p_e3_crs=e3w_b_crs, p_e3_max_crs=zs_crs)
+         CALL crs_dom_e3( e1u, e2u, zfse3u, p_sfc_2d_crs=e2u_crs  , cd_type='U', p_mask=umask, p_e3_crs=e3u_b_crs, p_e3_max_crs=zs_crs)
+         CALL crs_dom_e3( e1v, e2v, zfse3v, p_sfc_2d_crs=e1v_crs  , cd_type='V', p_mask=vmask, p_e3_crs=e3v_b_crs, p_e3_max_crs=zs_crs)
+
+         DO jk = 1, jpk
+            DO ji = 1, jpi_crs
+               DO jj = 1, jpj_crs
+                  IF( e3t_b_crs(ji,jj,jk) == 0._wp ) e3t_b_crs(ji,jj,jk) = e3t_1d(jk)
+                  IF( e3w_b_crs(ji,jj,jk) == 0._wp ) e3w_b_crs(ji,jj,jk) = e3w_1d(jk)
+                  IF( e3u_b_crs(ji,jj,jk) == 0._wp ) e3u_b_crs(ji,jj,jk) = e3t_1d(jk)
+                  IF( e3v_b_crs(ji,jj,jk) == 0._wp ) e3v_b_crs(ji,jj,jk) = e3t_1d(jk)
+               ENDDO
             ENDDO
-        ENDDO
-      ENDDO
-
-      e3t_n_crs(:,:,:) = e3t_a_crs(:,:,:)
-      e3u_n_crs(:,:,:) = e3u_a_crs(:,:,:)
-      e3v_n_crs(:,:,:) = e3v_a_crs(:,:,:)
-      e3w_n_crs(:,:,:) = e3w_a_crs(:,:,:)
+         ENDDO
+
+         e3t_n_crs(:,:,:) = e3t_a_crs(:,:,:)
+         e3u_n_crs(:,:,:) = e3u_a_crs(:,:,:)
+         e3v_n_crs(:,:,:) = e3v_a_crs(:,:,:)
+         e3w_n_crs(:,:,:) = e3w_a_crs(:,:,:)
 
       ENDIF
@@ -158,15 +148,12 @@
 #endif
 
-      !zmin=MINVAL();zmax=MAXVAL();CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld ",zmin,zmax 
-      !zmin=MINVAL();zmax=MAXVAL();CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld ",zmin,zmax 
-
       IF( kt /= nit000 )THEN
          emp_b_crs(:,:)        = emp_crs(:,:)
          rnf_b_crs(:,:)        = rnf_crs(:,:)
-         hdivb_crs(:,:,:)      = hdivn_crs(:,:,:) !cbr hdivb_crs pas utile ?????????????????????????????????
+         hdivb_crs(:,:,:)      = hdivn_crs(:,:,:)
       ELSE
          emp_b_crs(:,:    ) = 0._wp
          rnf_b_crs(:,:    ) = 0._wp
-         hdivb_crs(:,:,:  ) = 0._wp  !cbr hdivb_crs pas utile ?????????????????????????????????
+         hdivb_crs(:,:,:  ) = 0._wp
       ENDIF
 
@@ -181,8 +168,8 @@
       tsb_crs(:,:,:,jp_sal) = zs_crs(:,:,:)
 
-      !  U-velocity  !cb  pas utile ?????????????????????????????????
+      !  U-velocity
       CALL crs_dom_ope( ub, 'SUM', 'U', umask, ub_crs, p_e12=e2u, p_e3=zfse3u, p_surf_crs=e2e3u_msk, psgn=-1.0 )
 
-      !  V-velocity  pas utile ?????????????????????????????????
+      !  V-velocity
       CALL crs_dom_ope( vb, 'SUM', 'V', vmask, vb_crs, p_e12=e1v, p_e3=zfse3v, p_surf_crs=e1e3v_msk, psgn=-1.0 )
 
@@ -190,10 +177,10 @@
       CALL crs_dom_ope( rn2b, 'VOL', 'W', tmask, rb2_crs, p_e12=e1e2t, p_e3=zfse3t, psgn=1.0 )
 
-      !ssh !cbr pas utile ??????????????????????????????????????
+      !ssh
       zfse3t(:,:,:) = 1._wp
       CALL crs_dom_ope( sshb , 'VOL', 'T', tmask, sshb_crs , p_e12=e1e2t, p_e3=zfse3t         , psgn=1.0 )
 
       !---------------------------------------------------------------------------------------------------
-      !variables domaine au temps now : 
+      !variables at now time : 
       !---------------------------------------------------------------------------------------------------
 #if defined key_vvl
@@ -214,4 +201,6 @@
 
 #if defined key_vvl
+
+      ! surfaces
       CALL crs_dom_sfc( umask, 'U', e2e3u_crs, e2e3u_msk, p_e2=e2u, p_e3=zfse3u )
       CALL crs_dom_sfc( vmask, 'V', e1e3v_crs, e1e3v_msk, p_e1=e1v, p_e3=zfse3v )
@@ -220,5 +209,6 @@
       CALL iom_put("e1e3v_crs",e1e3v_crs)
       CALL iom_put("e1e3v_msk",e1e3v_msk)
-      !                                                                                 
+
+      ! vertical scale factors                                                                                 
       CALL crs_dom_e3( e1t, e2t, zfse3t, p_sfc_3d_crs=e1e2w_crs, cd_type='T', p_mask=tmask, p_e3_crs=zs_crs, p_e3_max_crs=e3t_max_n_crs)
       CALL crs_dom_e3( e1t, e2t, zfse3w, p_sfc_3d_crs=e1e2w_crs, cd_type='W', p_mask=tmask, p_e3_crs=zs_crs, p_e3_max_crs=e3w_max_n_crs)
@@ -226,12 +216,15 @@
       CALL crs_dom_e3( e1v, e2v, zfse3v, p_sfc_2d_crs=e1v_crs  , cd_type='V', p_mask=vmask, p_e3_crs=zs_crs, p_e3_max_crs=e3v_max_n_crs)
 
-     WHERE(e3t_max_n_crs == 0._wp) e3t_max_n_crs=r_inf
-     WHERE(e3u_max_n_crs == 0._wp) e3u_max_n_crs=r_inf
-     WHERE(e3v_max_n_crs == 0._wp) e3v_max_n_crs=r_inf
-     WHERE(e3w_max_n_crs == 0._wp) e3w_max_n_crs=r_inf
-
+      !cbr ??????????????????? faut pas mettre le profile 1d plutot ???????????
+      WHERE(e3t_max_n_crs == 0._wp) e3t_max_n_crs=r_inf
+      WHERE(e3u_max_n_crs == 0._wp) e3u_max_n_crs=r_inf
+      WHERE(e3v_max_n_crs == 0._wp) e3v_max_n_crs=r_inf
+      WHERE(e3w_max_n_crs == 0._wp) e3w_max_n_crs=r_inf
+
+      ! depth
       CALL crs_dom_ope( gdepw_n, 'MAX', 'T', tmask, gdept_n_crs, p_e3=zfse3t, psgn=1.0 )
       CALL crs_dom_ope( gdepw_n, 'MAX', 'W', tmask, gdepw_n_crs, p_e3=zfse3w, psgn=1.0 )
 
+      ! volume and facvol
       CALL crs_dom_facvol( tmask, 'T', e1t, e2t, zfse3t, ocean_volume_crs_t, facvol_t )
       CALL iom_put("cvol_crs_t",ocean_volume_crs_t)
@@ -306,14 +299,4 @@
          CASE ( 4 )
             CALL crs_dom_ope( avt, 'MED', 'W', tmask, avt_crs, p_e12=e1e2t, p_e3=zfse3w, psgn=1.0 )
-         CASE ( 5 )
-#if defined key_zdftke
-            CALL crs_dom_ope( en        , 'VOL', 'W', tmask, en_crs   , p_e12=e1e2t, p_e3=zfse3w         , psgn=1.0 )
-            CALL crs_dom_ope( taum      , 'SUM', 'T', tmask, taum_crs , p_e12=e1e2t, p_surf_crs=e1e2t_crs, psgn=1.0 )
-            CALL crs_dom_ope( rn2(:,:,:), 'VOL', 'W', tmask, rn2_crs  , p_e12=e1e2t, p_e3=zfse3t         , psgn=1.0 )
-            IF( kt==nit000 )CALL tke_avn_ini_crs
-            CALL tke_avn_crs
-            CALL zdf_evd_crs(kt)
-#endif
-
       END SELECT
       !
@@ -354,8 +337,4 @@
       CALL iom_put( "ssh"      , sshn_crs )   ! ssh output 
 
-      zmin=MINVAL(emp);zmax=MAXVAL(emp);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld emp",zmin,zmax 
-      zmin=MINVAL(emp_b);zmax=MAXVAL(emp_b);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld emp_b",zmin,zmax 
-      zmin=MINVAL(emp_crs);zmax=MAXVAL(emp_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld emp_crs",zmin,zmax 
-      zmin=MINVAL(emp_b_crs);zmax=MAXVAL(emp_b_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld emp_b_crs",zmin,zmax 
 
 #if defined key_vvl
@@ -364,12 +343,11 @@
       !---------------------------------------------------------------------------------------------------
 
-      !cbr ssha_crs utile ??????????????????
+      !ssha
       zfse3t(:,:,:) = 1._wp
       zt(:,:,:) = tmask(:,:,:)
       ssha(:,:) = ssha(:,:) * tmask(:,:,1)  !cbr utile ??????????????????
       CALL crs_dom_ope( ssha , 'VOL', 'T', zt, ssha_crs , p_e12=e1e2t,  p_e3=zfse3t , psgn=1.0 )
-      !CALL crs_lbc_lnk( ssha_crs, 'T', 1.0 ) !!!!!!!!!!!!!!!!!!! pas utile !!!!!!!!!!!!!!!!!!!!!!!!!
-
-
+
+      !vertical scale factors
       zfse3t(:,:,:) = e3t_a(:,:,:)
       zfse3u(:,:,:) = e3u_a(:,:,:)
@@ -381,17 +359,4 @@
       CALL crs_dom_e3( e1u, e2u, zfse3u, p_sfc_2d_crs=e2u_crs  , cd_type='U', p_mask=umask, p_e3_crs=e3u_a_crs, p_e3_max_crs=zs_crs)
       CALL crs_dom_e3( e1v, e2v, zfse3v, p_sfc_2d_crs=e1v_crs  , cd_type='V', p_mask=vmask, p_e3_crs=e3v_a_crs, p_e3_max_crs=zs_crs)
-
-
-      !DO ji=1,jpi_crs
-      !   DO jj=1,jpj_crs
-      !      fse3t_a_crs(ji,jj,jk),fse3t_b_crs(ji,jj,jk)+fse3t_n_crs(ji,jj,jk)*(ssha_crs(ji,jj)-sshb_crs(ji,jj))/(ht_0_crs(ji,jj)+sshn_crs(ji,jj))
-      !   ENDDO
-      !ENDDO
-      !CALL dom_vvl_interpol_crs( fse3t_a_crs(:,:,:), fse3u_a(:,:,:), 'U' )
-      !CALL dom_vvl_interpol_crs( fse3t_a_crs(:,:,:), fse3v_a(:,:,:), 'V' )
-      !CALL dom_vvl_interpol_crs( fse3t_a_crs(:,:,:), fse3w_a(:,:,:), 'W' )
-
-      !CALL crs_dom_sfc( umask, 'U', zt_crs, zs_crs, p_e2=e2u, p_e3=zfse3u ) ! zt_crs=e2e3u_crs,zs_crs=e2e3u_msk ça sert à quoi ???????????????????????????????????????????
-      !CALL crs_dom_sfc( vmask, 'V', zt_crs, zs_crs, p_e1=e2v, p_e3=zfse3v ) ! zt_crs=e1e3v_crs,zs_crs=e1e3v_msk ça sert à quoi ???????????????????????????????????????????
 
       DO jk = 1, jpk
@@ -405,17 +370,4 @@
         ENDDO
       ENDDO
-
-      zmin=MINVAL(e3t_b);zmax=MAXVAL(e3t_b);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_b",zmin,zmax 
-      zmin=MINVAL(e3t_n);zmax=MAXVAL(e3t_n);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_n",zmin,zmax 
-      zmin=MINVAL(e3t_a);zmax=MAXVAL(e3t_a);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_a",zmin,zmax 
-      zmin=MINVAL(e3t_b_crs);zmax=MAXVAL(e3t_b_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_b_crs",zmin,zmax 
-      zmin=MINVAL(e3t_n_crs);zmax=MAXVAL(e3t_n_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_n_crs",zmin,zmax 
-      zmin=MINVAL(e3t_a_crs);zmax=MAXVAL(e3t_a_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld e3t_a_crs",zmin,zmax 
-      zmin=MINVAL(sshb);zmax=MAXVAL(sshb);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld sshb",zmin,zmax 
-      zmin=MINVAL(sshn);zmax=MAXVAL(sshn);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld sshn",zmin,zmax 
-      zmin=MINVAL(ssha);zmax=MAXVAL(ssha);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld ssha",zmin,zmax 
-      zmin=MINVAL(sshb_crs);zmax=MAXVAL(sshb_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld sshb_crs",zmin,zmax 
-      zmin=MINVAL(sshn_crs);zmax=MAXVAL(sshn_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld sshn_crs",zmin,zmax 
-      zmin=MINVAL(ssha_crs);zmax=MAXVAL(ssha_crs);CALL mpp_min(zmin);CALL mpp_max(zmax);IF(lwp)WRITE(numout,*)"crsfld ssha_crs",zmin,zmax 
 
       !zt_crs=ocean_volume_crs_t ; zs_crs=facvol_t after time !!! ça sert à quoi ???????????????????????????????????????????
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 7217)
@@ -73,5 +73,5 @@
       REAL(wp), DIMENSION(:,:,:), POINTER :: zfse3t, zfse3u, zfse3v, zfse3w
 
-      NAMELIST/namcrs/ nn_factx, nn_facty, nn_binref, nn_msh_crs, nn_crs_kz, ln_crs_wn, ln_crs_top
+      NAMELIST/namcrs/ nn_factx, nn_facty, nn_msh_crs, nn_crs_kz, ln_crs_wn, ln_crs_top
       !!----------------------------------------------------------------------
       !
@@ -102,5 +102,4 @@
         WRITE(numout,*) '   coarsening factor in i-direction      nn_factx   = ', nn_factx
         WRITE(numout,*) '   coarsening factor in j-direction      nn_facty   = ', nn_facty
-        WRITE(numout,*) '   bin centering preference              nn_binref  = ', nn_binref
         WRITE(numout,*) '   create (=1) a mesh file or not (=0)   nn_msh_crs = ', nn_msh_crs
         WRITE(numout,*) '   type of Kz coarsening (0,1,2)         nn_crs_kz  = ', nn_crs_kz
@@ -113,5 +112,4 @@
            CASE ( 3 ) ; WRITE(numout,*) '   coarsene KZ with MEANLOG(KZ)'
            CASE ( 4 ) ; WRITE(numout,*) '   coarsene KZ with MEDIANE(KZ)'
-           CASE ( 5 ) ; WRITE(numout,*) '   coarsene KZ with TKE coarsening'
        END SELECT
      ENDIF
@@ -129,6 +127,4 @@
      ! 3. Mask and Mesh
      !---------------------------------------------------------
-
-     !     Set up the masks and meshes     
 
      !  3.a. Get the masks   
@@ -201,5 +197,4 @@
      CALL crs_dom_sfc( vmask, 'V', e1e3v_crs, e1e3v_msk, p_e1=e1v, p_e3=zfse3v )
 
-     !cbr utile ????????????????????????????????
      DO jk=1,jpk
         DO ji=1,jpi_crs
@@ -259,5 +254,4 @@
      ENDDO
 
-!cbr utile ???????? on le fait ds crsfld, nan ?
 #if defined key_vvl
      e3t_b_crs(:,:,:) = e3t_0_crs(:,:,:)
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 7217)
@@ -43,5 +43,4 @@
    INTEGER , PUBLIC ::   nn_closea       !: =0 suppress closed sea/lake from the ORCA domain or not (=1)
    INTEGER , PUBLIC ::   nn_euler        !: =0 start with forward time step or not (=1)
-   LOGICAL , PUBLIC ::   ln_crs          !: Apply grid coarsening to dynamical model output or online passive tracers
 
    !! Time splitting parameters
@@ -314,4 +313,13 @@
 
    !!----------------------------------------------------------------------
+   !! coarsening for output and/or BCG 
+   !!----------------------------------------------------------------------
+#if defined key_crs
+   LOGICAL, PUBLIC, PARAMETER ::   lk_crs = .TRUE.    !: crs flag
+#else
+   LOGICAL, PUBLIC, PARAMETER ::   lk_crs = .FALSE.   !: crs flag
+#endif
+
+   !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 7217)
@@ -141,5 +141,5 @@
       NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,   &
          &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin ,                  &
-         &             rn_rdtmax, rn_rdth     , nn_closea , ln_crs,    &
+         &             rn_rdtmax, rn_rdth     , nn_closea   ,  &
          &             jphgr_msh, &
          &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m, &
@@ -273,5 +273,4 @@
          WRITE(numout,*) '                  depth of transition       rn_rdth   = ', rn_rdth
          WRITE(numout,*) '      suppression of closed seas (=0)       nn_closea = ', nn_closea
-         WRITE(numout,*) '      online coarsening of dynamical fields ln_crs    = ', ln_crs
          WRITE(numout,*) '      type of horizontal mesh jphgr_msh           = ', jphgr_msh
          WRITE(numout,*) '      longitude of first raw and column T-point ppglam0 = ', ppglam0
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 7217)
@@ -22,5 +22,5 @@
                        gphiv, gphif, &
                        agrif_root, agrif_cfixed, lk_agrif, &
-                       rdt,rdttra, gdept_0, ln_crs, gdepw_0,  adatrj, fjulday, &
+                       rdt,rdttra, gdept_0, gdepw_0,  adatrj, fjulday, &
                        mikt
 
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7217)
@@ -395,5 +395,5 @@
       IF( ln_ctl        )   CALL prt_ctl_init   ! Print control
 
-      IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid
+      IF( lk_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid
 
                             CALL  istate_init   ! ocean initial state (Dynamics and tracers)
@@ -410,5 +410,5 @@
                             CALL dyn_nept_init  ! simplified form of Neptune effect
       !     
-      IF( ln_crs        )   CALL     eos_init_crs   ! Equation of state
+      IF( lk_crs        )   CALL     eos_init_crs   ! Equation of state
       !
                                 ! Ocean physics
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7217)
@@ -93,10 +93,10 @@
          ! must be done after nemo_init for AGRIF+XIOS+OASIS
                       CALL iom_init(      cxios_context          )  ! iom_put initialization
-         IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" )  ! initialize context for coarse grid
+         IF( lk_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" )  ! initialize context for coarse grid
       ENDIF
 
       IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
                              CALL iom_setkt( kstp - nit000 + 1,      cxios_context          )   ! tell iom we are at time step kstp
-      IF( ln_crs     )       CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell iom we are at time step kstp
+      IF( lk_crs     )       CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell iom we are at time step kstp
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -236,5 +236,5 @@
                             CALL dia_wri( kstp )         ! ocean model: outputs
       !
-      IF( ln_crs     )      CALL crs_fld( kstp )         ! ocean model: online field coarsening & output
+      IF( lk_crs     )      CALL crs_fld( kstp )         ! ocean model: online field coarsening & output
 
       CALL wrk_alloc( jpi, jpj, jpk, zrhop, zrhd )
@@ -249,5 +249,5 @@
       ! Passive Tracer Model
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      IF( ln_crs )   THEN
+      IF( lk_crs )   THEN
                          CALL dom_grid_crs
 
@@ -391,5 +391,5 @@
       IF( kstp == nitend .OR. indic < 0 ) THEN 
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
+         IF( lk_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
       ENDIF
 #endif
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcwri_my_trc.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcwri_my_trc.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcwri_my_trc.F90	(revision 7217)
@@ -14,5 +14,5 @@
    USE trc         ! passive tracers common variables 
    USE oce_trc
-   USE crs, ONLY : ln_crs,ln_crs_top,ahtt_crs,ahtu_crs,ahtv_crs,ahtw_crs,jpi_crs,jpj_crs
+   USE crs, ONLY : ln_crs_top !cbr ????,ahtt_crs,ahtu_crs,ahtv_crs,ahtw_crs,jpi_crs,jpj_crs
    USE iom, ONLY : iom_swap, iom_put
    USE ieee_arithmetic
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7217)
@@ -34,5 +34,5 @@
    USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
    USE zpshde_crs      ! partial step: hor. derivative       (zps_hde routine)
-   USE dom_oce , ONLY : ln_crs, ln_isfcav
+   USE dom_oce , ONLY : ln_isfcav
    USE crs     , ONLY : jpi_crs,jpj_crs,wn_crs,ln_crs_top,sbc_trc_crs,sbc_trc_b_crs
    USE ldfslp_crs
@@ -76,7 +76,5 @@
       IF( .NOT. lk_c1d ) THEN
          !
-         CALL test(kstp,1)
                                CALL trc_sbc( kstp )
-         CALL test(kstp,2)
          IF( ln_crs_top ) THEN ;    CALL trc_bbl_crs( kstp )
          ELSE              ;    CALL trc_bbl( kstp )
@@ -84,15 +82,12 @@
          IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
 
-         CALL test(kstp,3)
          IF( ln_crs_top ) THEN ;    CALL trc_adv_crs( kstp )
          ELSE              ;    CALL trc_adv( kstp )
          ENDIF
 
-         CALL test(kstp,4)
          IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
          IF( ln_crs_top ) THEN ;    CALL trc_ldf_crs( kstp )
          ELSE              ;    CALL trc_ldf( kstp )
          ENDIF
-         CALL test(kstp,5)
          IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
             &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
@@ -103,8 +98,6 @@
          ELSE              ;    CALL trc_zdf( kstp )
          ENDIF
-         CALL test(kstp,6)
 
                                 CALL trc_nxt( kstp )            ! tracer fields at next time step     
-         CALL test(kstp,10)
          IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
 
@@ -140,29 +133,4 @@
    END SUBROUTINE trc_trp
 
-   SUBROUTINE test(kt,i)
-   INTEGER,INTENT(IN) :: kt,i
-   REAL(wp)::zmin,zmax
-   INTEGER :: ji,jj,jk
-   zmin=MINVAL( trb(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
-   zmax=MAXVAL( trb(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
-   IF(lwp)WRITE(numout,*)"trctrp b ",kt,i,zmin,zmax   
-   zmin=MINVAL( trn(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
-   zmax=MAXVAL( trn(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
-   IF(lwp)WRITE(numout,*)"trctrp n ",kt,i,zmin,zmax   
-   zmin=MINVAL( tra(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
-   zmax=MAXVAL( tra(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
-   IF(lwp)WRITE(numout,*)"trctrp a ",kt,i,zmin,zmax   
-
-   DO ji=1,jpi
-   DO jj=1,jpj
-   DO jk=1,jpk
-   IF( ieee_is_nan(tra(ji,jj,jk,1)))WRITE(narea+200,*)"test nan a",kt,i,ji,jj,jk,tmask(ji,jj,jk)
-   IF( ieee_is_nan(trn(ji,jj,jk,1)))WRITE(narea+200,*)"test nan n",kt,i,ji,jj,jk,tmask(ji,jj,jk)
-   IF( ieee_is_nan(trb(ji,jj,jk,1)))WRITE(narea+200,*)"test nan b",kt,i,ji,jj,jk,tmask(ji,jj,jk)
-   ENDDO
-   ENDDO
-   ENDDO
-
-   END SUBROUTINE test
 #else
    !!----------------------------------------------------------------------
Index: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 7215)
+++ branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 7217)
@@ -30,5 +30,5 @@
    USE trcsub          ! variables to substep passive tracers
    USE lib_mpp         ! distribued memory computing library
-   USE crs    , ONLY : ln_crs
+   USE crs    , ONLY : ln_crs_top
    USE dom_oce, ONLY : nn_cla, ln_isfcav
    USE trcice          ! tracers in sea ice
@@ -148,5 +148,5 @@
  
       tra(:,:,:,:) = 0._wp
-      IF( ln_crs )  THEN
+      IF( ln_crs_top)  THEN
          CALL zps_hde_crs( nit000, jptra, trn, gtru, gtrv )
       ELSE
