Index: /trunk/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 3970)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 3971)
@@ -59,6 +59,7 @@
 
                              indic = 0                ! reset to no error condition
+      IF( kstp == nit000 )   CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
       IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
-                             CALL iom_setkt( kstp )   ! say to iom that we are at time step kstp
+                             CALL iom_setkt( kstp - nit000 + 1 )   ! say to iom that we are at time step kstp
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -106,4 +107,6 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL dia_wri( kstp )       ! ocean model: outputs
+      IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C)
+
 
 #if defined key_top
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 3970)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 3971)
@@ -1443,8 +1443,11 @@
          WRITE(numout,"(10x,i4,4f9.2)") ( jk, fsdept(1,1,jk), fsdepw(1,1,jk),     &
             &                                 fse3t (1,1,jk), fse3w (1,1,jk), jk=1,jpk )
-         DO jj = mj0(20), mj1(20)
-            DO ji = mi0(20), mi1(20)
+         iip1 = MIN(20, jpiglo-1)  ! for config with i smaller than 20 points
+         ijp1 = MIN(20, jpjglo-1)  ! for config with j smaller than 20 points
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
@@ -1453,8 +1456,11 @@
             END DO
          END DO
-         DO jj = mj0(74), mj1(74)
-            DO ji = mi0(100), mi1(100)
+         iip1 = MIN(  74, jpiglo-1)
+         ijp1 = MIN( 100, jpjglo-1)
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3970)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3971)
@@ -99,5 +99,9 @@
       clname = "nemo"
       IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname)
+#if defined key_mpp_mpi
       CALL xios_context_initialize(TRIM(clname), mpi_comm_opa)
+#else
+      CALL xios_context_initialize(TRIM(clname), 0)
+#endif
       CALL iom_swap
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 3970)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 3971)
@@ -283,38 +283,4 @@
    END SUBROUTINE lbc_lnk_3d
 
-   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE lbc_bdy_lnk  ***
-      !!
-      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
-      !!                to maintain the same interface with regards to the mpp case
-      !!
-      !!----------------------------------------------------------------------
-      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
-      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
-      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
-      !!
-      CALL lbc_lnk_3d( pt3d, cd_type, psgn)
-
-   END SUBROUTINE lbc_bdy_lnk_3d
-
-   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE lbc_bdy_lnk  ***
-      !!
-      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
-      !!                to maintain the same interface with regards to the mpp case
-      !!
-      !!----------------------------------------------------------------------
-      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
-      REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied
-      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
-      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
-      !!
-      CALL lbc_lnk_2d( pt2d, cd_type, psgn)
-
-   END SUBROUTINE lbc_bdy_lnk_2d
-
    SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval )
       !!---------------------------------------------------------------------
@@ -406,4 +372,44 @@
    END SUBROUTINE lbc_lnk_2d
 
+#endif
+
+
+   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE lbc_bdy_lnk  ***
+      !!
+      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
+      !!                to maintain the same interface with regards to the mpp
+      !case
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
+      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
+      !!
+      CALL lbc_lnk_3d( pt3d, cd_type, psgn)
+
+   END SUBROUTINE lbc_bdy_lnk_3d
+
+   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE lbc_bdy_lnk  ***
+      !!
+      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
+      !!                to maintain the same interface with regards to the mpp
+      !case
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
+      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
+      !!
+      CALL lbc_lnk_2d( pt2d, cd_type, psgn)
+
+   END SUBROUTINE lbc_bdy_lnk_2d
+
+
    SUBROUTINE lbc_lnk_2d_e( pt2d, cd_type, psgn, jpri, jprj )
       !!---------------------------------------------------------------------
@@ -430,5 +436,4 @@
    END SUBROUTINE lbc_lnk_2d_e
 
-# endif
 #endif
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 3970)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 3971)
@@ -30,4 +30,5 @@
    USE lbclnk          ! lateral boudary conditions
    USE lib_mpp         ! distributed memory computing
+   USE c1d               ! 1D vertical configuration
    USE in_out_manager  ! I/O manager
    USE timing          ! timing
@@ -271,4 +272,5 @@
       
       ! SOR and PCG solvers
+      IF( lk_c1d ) CALL lbc_lnk( gcdmat, 'T', 1._wp ) ! 1D case bmask =/0  but gcdmat not define everywhere 
       DO jj = 1, jpj
          DO ji = 1, jpi
