Index: /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90
===================================================================
--- /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90	(revision 10105)
+++ /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crs.F90	(revision 10106)
@@ -120,4 +120,5 @@
       REAL(wp), DIMENSION(:,:),   ALLOCATABLE,SAVE :: ff_crs
       INTEGER,  DIMENSION(:,:),   ALLOCATABLE,SAVE :: mbathy_crs, mbkt_crs, mbku_crs, mbkv_crs
+      INTEGER,  DIMENSION(:,:),   ALLOCATABLE,SAVE :: mikt_crs
 
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE,SAVE :: gdept_0_crs, gdepu_0_crs, gdepv_0_crs, gdepw_0_crs
@@ -169,4 +170,5 @@
       REAL(wp), PUBLIC, DIMENSION(:,:)  , ALLOCATABLE :: rnf_crs,rnf_b_crs,h_rnf_crs
       INTEGER , PUBLIC, DIMENSION(:,:)  , ALLOCATABLE :: nk_rnf_crs
+      REAL(wp), PUBLIC, DIMENSION(:,:)  , ALLOCATABLE :: fwfisf_b_crs, fwfisf_crs
       REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: trc_i_crs,trc_o_crs
       REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: sbc_trc_crs, sbc_trc_b_crs
@@ -284,5 +286,6 @@
 
       ALLOCATE( mbathy_crs(jpi_crs,jpj_crs), mbkt_crs(jpi_crs,jpj_crs) , &
-         &      mbku_crs(jpi_crs,jpj_crs)  , mbkv_crs(jpi_crs,jpj_crs) , STAT=ierr(9))
+         &      mbku_crs(jpi_crs,jpj_crs)  , mbkv_crs(jpi_crs,jpj_crs) , & 
+         &      mikt_crs(jpi_crs,jpj_crs)  , STAT=ierr(9))
 
       ALLOCATE( gdept_0_crs(jpi_crs,jpj_crs,jpk), gdepu_0_crs(jpi_crs,jpj_crs,jpk) , &
@@ -310,4 +313,5 @@
          &     rnf_crs (jpi_crs,jpj_crs), rnf_b_crs(jpi_crs ,jpj_crs), nk_rnf_crs(jpi_crs ,jpj_crs), h_rnf_crs(jpi_crs ,jpj_crs), &
          &     emp_crs (jpi_crs,jpj_crs), emp_b_crs(jpi_crs,jpj_crs), &
+         &     fwfisf_crs(jpi_crs,jpj_crs), fwfisf_b_crs(jpi_crs,jpj_crs), &
          &     sbc_trc_crs (jpi_crs,jpj_crs,jpts), sbc_trc_b_crs(jpi_crs,jpj_crs,jpts), &
          &     trc_i_crs (jpi_crs,jpj_crs,jpts), trc_o_crs(jpi_crs,jpj_crs,jpts), &
Index: /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
===================================================================
--- /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 10105)
+++ /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 10106)
@@ -1736,4 +1736,34 @@
    END SUBROUTINE crs_dom_bat
 
+   SUBROUTINE crs_dom_top
+      !!----------------------------------------------------------------
+      !!               *** SUBROUTINE crs_dom_top ***
+      !!
+      !! ** Purpose :  coarsening mikt
+      !!
+      !!----------------------------------------------------------------
+      INTEGER ::  ji, jj, jk
+      INTEGER ::  ijis, ijie, ijjs, ijje
+
+      !!----------------------------------------------------------------
+
+      DO jj  = nldj_crs,nlej_crs
+
+         ijjs = mjs_crs(jj)
+         ijje = mje_crs(jj)
+
+         DO ji = nldi_crs, nlei_crs
+
+            ijis = mis_crs(ji)
+            ijie = mie_crs(ji)
+
+            mikt_crs(ji,jj) = MINVAL( mikt(ijis:ijie,ijjs:ijje) )
+         ENDDO
+      ENDDO
+
+      mikt_crs = MAX( mikt_crs , 1 )
+
+   END SUBROUTINE crs_dom_top
+
    SUBROUTINE PIKSRT(N,ARR)
      INTEGER                  ,INTENT(IN) :: N
Index: /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90
===================================================================
--- /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 10105)
+++ /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/CRS/crsfld.F90	(revision 10106)
@@ -156,4 +156,5 @@
       CALL crs_dom_ope( rnf_b ,'SUM', 'T', tmask, rnf_b_crs , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
       CALL crs_dom_ope( emp_b ,'SUM', 'T', tmask, emp_b_crs , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
+      CALL crs_dom_ope( fwfisf_b  ,'SUM', 'T', tmask, fwfisf_b_crs  , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
 
       !  Temperature
@@ -303,4 +304,5 @@
       CALL crs_dom_ope( emp   ,'SUM', 'T', tmask, emp_crs   , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
       CALL crs_dom_ope( fmmflx,'SUM', 'T', tmask, fmmflx_crs, p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
+      CALL crs_dom_ope( fwfisf,'SUM', 'T', tmask, fwfisf_crs   , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
 
       CALL crs_dom_ope( fr_i  ,'SUM', 'T', tmask, fr_i_crs  , p_e12=e1e2t, p_surf_crs=e1e2w_msk(:,:,1), psgn=1.0 )
Index: /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
===================================================================
--- /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 10105)
+++ /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 10106)
@@ -460,15 +460,23 @@
                   ztc_f  = ztc_n  + atfp * ztc_d
                   !
-                  IF( jk == 1 ) THEN           ! first level 
-                     ze3t_f = ze3t_f - zfact2 * ( emp_b_crs(ji,jj) - emp_crs(ji,jj) + rnf_crs(ji,jj) - rnf_b_crs(ji,jj) )
+                  IF( jk == mikt_crs(ji,jj) ) THEN           ! first level 
+                     ze3t_f = ze3t_f - zfact2 * ( (emp_b_crs(ji,jj)    - emp_crs(ji,jj)   )  &
+                            &                   - (rnf_b_crs(ji,jj)    - rnf_crs(ji,jj)   )  &
+                            &                   + (fwfisf_b_crs(ji,jj) - fwfisf_crs(ji,jj))  )
                      ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) )
                   ENDIF
-!cbr as it is a subroutine dedicated to crs, TRA options are not necessary
-!cbr                  IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )   &     ! solar penetration (temperature only)
-!cbr                     &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )
-!cbr
-!cbr                  IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )   &                  ! river runoffs
-!cbr                     &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &
-!cbr                     &                              * fse3t_n(ji,jj,jk) / h_rnf(ji,jj)
+
+                  !cbr: not adapted for coarsening for the moment
+                  ! ice shelf
+                  !IF( ll_isf ) THEN
+                  !   ! level fully include in the Losch_2008 ice shelf boundary layer
+                  !   IF ( jk >= misfkt(ji,jj) .AND. jk < misfkb(ji,jj) )                          &
+                  !      ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  &
+                  !             &                 * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj)
+                  !   ! level partially include in Losch_2008 ice shelf boundary layer 
+                  !   IF ( jk == misfkb(ji,jj) )                                                   &
+                  !      ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  &
+                  !             &                 * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj) * ralpha(ji,jj)
+                  !END IF
 
                   ze3t_f = 1.e0 / ze3t_f
@@ -476,8 +484,4 @@
                   ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)     ! ptn <-- pta
                   !
-                  IF( ll_tra_hpg ) THEN        ! semi-implicit hpg (T & S only)
-                     ze3t_d           = 1.e0   / ( ze3t_n + rbcp * ze3t_d )
-                     pta(ji,jj,jk,jn) = ze3t_d * ( ztc_n  + rbcp * ztc_d  )   ! ta <-- Brown & Campana average
-                  ENDIF
                END DO
             END DO
Index: /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 10105)
+++ /NEMO/branches/2018/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 10106)
@@ -122,5 +122,4 @@
    USE dom_oce , ONLY : ln_sco => ln_sco
    USE dom_oce , ONLY : neuler => neuler
-   USE dom_oce , ONLY : mikt      => mikt          !: f-points (m)
 
    USE crs,  ONLY : mi0 => mi0 
@@ -193,4 +192,5 @@
    USE crs , ONLY :     e3t_0    =>    e3t_0_crs       !: depth of t-points (m)
    USE crs , ONLY :   mbkt       =>   mbkt_crs       !: vertical index of the bottom last T- ocean level
+   USE crs , ONLY :   mikt       =>   mikt_crs       !: vertical index of the top first T- ocean level
    USE crs , ONLY :   tmask_i    =>   tmask_i_crs    !: Interior mask at t-points
    USE crs , ONLY :   tmask      =>   tmask_crs      !: land/ocean mask at t-points
