Index: anches/2013/dev_LOCEAN_2013/NEMOGCM/ARCH/OLD/arch-PW7_METO.fcm
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/ARCH/OLD/arch-PW7_METO.fcm	(revision 4161)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# IBM POWER6  UKMO
-# NCDF_INC    netcdf include file
-# NCDF_LIB    netcdf library
-# FC          Fortran compiler command
-# FCFLAGS     Fortran compiler flags
-# FFLAGS      Fortran 77 compiler flags
-# LD          linker
-# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-# FPPFLAGS    pre-processing flags
-# AR          assembler
-# ARFLAGS     assembler flags
-# MK          make
-# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
-# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
-
-
-%NCDF_INC            -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/include
-%NCDF_LIB            -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict 
-%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict 
-%LD                  mpxlf90_r
-%LDFLAGS             -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS
-%FPPFLAGS            -E -P -traditional -I/opt/ibmhpc/pecurrent/ppe.poe/include -I/usr/lpp/ppe.poe/include/thread64
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/ARCH/arch-PW7_METO.fcm
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/ARCH/arch-PW7_METO.fcm	(revision 4162)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/ARCH/arch-PW7_METO.fcm	(revision 4162)
@@ -0,0 +1,30 @@
+# IBM POWER6  UKMO
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
+%NCDF_INC            -I/home/nwp/nm/frrj/lib/MTOOLS/include
+%NCDF_LIB            -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -lhdf5 -lhdf5_hl -lhdf5_fortran -lz
+%XIOS_ROOT           /home/cr/ocean/hadcv/xios_r445
+%FC                  mpxlf90_r
+%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict
+%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict
+%LD                  mpCC_r
+%LDFLAGS             -lxlf90 -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS
+%FPPFLAGS            -E -P -traditional -I/opt/ibmhpc/pecurrent/ppe.poe/include -I/usr/lpp/ppe.poe/include/thread64
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
+%USER_LIB            %NCDF_LIB -L%XIOS_ROOT/lib -lxios
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 4162)
@@ -675,17 +675,7 @@
       ! used to prevent the applied increments taking the temperature below the local freezing point 
 
-#if defined key_cice 
-        fzptnz(:,:,:) = -1.8_wp
-#else 
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpk
-                 fzptnz (ji,jj,jk) = ( -0.0575_wp + 1.710523e-3_wp * SQRT( tsn(ji,jj,jk,jp_sal) )                   & 
-                                                  - 2.154996e-4_wp *       tsn(ji,jj,jk,jp_sal)   ) * tsn(ji,jj,jk,jp_sal)  & 
-                                                  - 7.53e-4_wp * fsdepw(ji,jj,jk)       ! (pressure in dbar) 
-              END DO
-           END DO
-        END DO
-#endif 
+      DO jk=1, jpkm1
+         fzptnz (:,:,jk) = tfreez( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) )
+      ENDDO
 
       IF ( ln_asmiau ) THEN
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 4162)
@@ -36,8 +36,8 @@
    LOGICAL, PUBLIC ::   ln_diahsb   !: check the heat and salt budgets
 
-   REAL(wp), SAVE                                ::   frc_t      , frc_s     , frc_v   ! global forcing trends
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ssh_ini              !
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hc_loc_ini, sc_loc_ini, e3t_ini  !
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hcssh_loc_ini, scssh_loc_ini     !
+   REAL(dp), SAVE                                ::   frc_t      , frc_s     , frc_v   ! global forcing trends
+   REAL(dp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ssh_ini              !
+   REAL(dp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hc_loc_ini, sc_loc_ini, e3t_ini  !
+   REAL(dp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hcssh_loc_ini, scssh_loc_ini     !
 
    !! * Substitutions
@@ -67,12 +67,12 @@
       !!
       INTEGER    ::   jk                          ! dummy loop indice
-      REAL(wp)   ::   zdiff_hc    , zdiff_sc      ! heat and salt content variations
-      REAL(wp)   ::   zdiff_v1    , zdiff_v2      ! volume variation
-      REAL(wp)   ::   z_hc        , z_sc          ! heat and salt content
-      REAL(wp)   ::   z_v1        , z_v2          ! volume
-      REAL(wp)   ::   zdeltat                     !    -     -
-      REAL(wp)   ::   z_frc_trd_t , z_frc_trd_s   !    -     -
-      REAL(wp)   ::   z_frc_trd_v                 !    -     -
-      REAL(wp), POINTER, DIMENSION(:,:)   ::   zsurf              !
+      REAL(dp)   ::   zdiff_hc    , zdiff_sc      ! heat and salt content variations
+      REAL(dp)   ::   zdiff_v1    , zdiff_v2      ! volume variation
+      REAL(dp)   ::   z_hc        , z_sc          ! heat and salt content
+      REAL(dp)   ::   z_v1        , z_v2          ! volume
+      REAL(dp)   ::   zdeltat                     !    -     -
+      REAL(dp)   ::   z_frc_trd_t , z_frc_trd_s   !    -     -
+      REAL(dp)   ::   z_frc_trd_v                 !    -     -
+      REAL(dp), POINTER, DIMENSION(:,:)   ::   zsurf              !
       !!---------------------------------------------------------------------------
       IF( nn_timing == 1 )   CALL timing_start('dia_hsb')      
@@ -88,4 +88,8 @@
       z_frc_trd_t =           glob_sum( sbc_tsc(:,:,jp_tem) * zsurf(:,:) )       ! heat fluxes
       z_frc_trd_s =           glob_sum( sbc_tsc(:,:,jp_sal) * zsurf(:,:) )       ! salt fluxes
+      !
+      IF( ln_rnf    )   z_frc_trd_t = z_frc_trd_t + glob_sum( rnf_tsc(:,:,jp_tem) * zsurf(:,:) )
+      IF( ln_rnf_sal)   z_frc_trd_s = z_frc_trd_s + glob_sum( rnf_tsc(:,:,jp_sal) * zsurf(:,:) )
+
       ! Add penetrative solar radiation
       IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( qsr     (:,:) * zsurf(:,:) )
@@ -100,7 +104,7 @@
       ! 2a -  Content variations !
       ! ------------------------ !
-      zdiff_v2 = 0._wp
-      zdiff_hc = 0._wp
-      zdiff_sc = 0._wp
+      zdiff_v2 = 0._dp
+      zdiff_hc = 0._dp
+      zdiff_sc = 0._dp
       ! volume variation (calculated with ssh)
       zdiff_v1 = glob_sum( zsurf(:,:) * ( sshn(:,:) - ssh_ini(:,:) ) )
@@ -122,18 +126,18 @@
       
       ! add ssh if not vvl
-#if ! defined key_vvl
-     zdiff_v2 = zdiff_v2 + zdiff_v1
-     zdiff_hc = zdiff_hc + glob_sum( zsurf(:,:) * ( sshn(:,:) * tsn(:,:,1,jp_tem)   &
-            &                           - hcssh_loc_ini(:,:) ) )
-     zdiff_sc = zdiff_sc + glob_sum( zsurf(:,:) * ( sshn(:,:) * tsn(:,:,1,jp_sal)   &
-            &                           - scssh_loc_ini(:,:) ) )
-#endif 
+      IF( .NOT. lk_vvl ) THEN
+        zdiff_v2 = zdiff_v2 + zdiff_v1
+        zdiff_hc = zdiff_hc + glob_sum( zsurf(:,:) * ( sshn(:,:) * tsn(:,:,1,jp_tem)   &
+               &                           - hcssh_loc_ini(:,:) ) )
+        zdiff_sc = zdiff_sc + glob_sum( zsurf(:,:) * ( sshn(:,:) * tsn(:,:,1,jp_sal)   &
+               &                           - scssh_loc_ini(:,:) ) )
+      ENDIF
       !
       ! ----------------------- !
       ! 2b -  Content           !
       ! ----------------------- !
-      z_v2 = 0._wp
-      z_hc = 0._wp
-      z_sc = 0._wp
+      z_v2 = 0._dp
+      z_hc = 0._dp
+      z_sc = 0._dp
       ! volume (calculated with ssh)
       z_v1 = glob_sum( zsurf(:,:) * sshn(:,:) )
@@ -147,9 +151,9 @@
       ENDDO
       ! add ssh if not vvl
-#if ! defined key_vvl
-     z_v2 = z_v2 + z_v1
-     z_hc = z_hc + glob_sum( zsurf(:,:) * sshn(:,:) * tsn(:,:,1,jp_tem) )
-     z_sc = z_sc + glob_sum( zsurf(:,:) * sshn(:,:) * tsn(:,:,1,jp_sal) )
-#endif 
+      IF( .NOT. lk_vvl ) THEN
+        z_v2 = z_v2 + z_v1
+        z_hc = z_hc + glob_sum( zsurf(:,:) * sshn(:,:) * tsn(:,:,1,jp_tem) )
+        z_sc = z_sc + glob_sum( zsurf(:,:) * sshn(:,:) * tsn(:,:,1,jp_sal) )
+      ENDIF
 
       ! ----------------------- !
@@ -160,5 +164,5 @@
       CALL iom_put( 'bgtemper' , z_hc / z_v2 )                      ! Temperature (C) 
       CALL iom_put( 'bgsaline' , z_sc / z_v2 )                      ! Salinity (psu)
-      CALL iom_put( 'bgheatco' , zdiff_hc * rau0 * rcp * 1.e-9_wp ) ! Heat content variation (10^9 J)
+      CALL iom_put( 'bgheatco' , zdiff_hc * rau0 * rcp * 1.e-9_dp ) ! Heat content variation (10^9 J)
       CALL iom_put( 'bgsaltco' , zdiff_sc * 1.e-9 )                 ! Salt content variation (psu*km3) 
       CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9 )                    ! volume ssh (km3)  
@@ -166,5 +170,5 @@
       CALL iom_put( 'bgvoltot' , zdiff_v2 * 1.e-9 )                 ! volume total (km3) 
       CALL iom_put( 'bgfrcvol' , frc_v * 1.e-9 )                     ! vol - surface forcing (volume) 
-      CALL iom_put( 'bgfrctem' , frc_t * rau0 * rcp * 1.e-9_wp ) ! hc  - surface forcing (heat content) 
+      CALL iom_put( 'bgfrctem' , frc_t * rau0 * rcp * 1.e-9_dp ) ! hc  - surface forcing (heat content) 
       CALL iom_put( 'bgfrcsal' , frc_s * 1.e-9 )                     ! sc  - surface forcing (salt content) 
       !
@@ -286,7 +290,7 @@
           hcssh_loc_ini(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:)   ! initial heat content in ssh
           scssh_loc_ini(:,:) = tsn(:,:,1,jp_sal) * sshn(:,:)   ! initial salt content in ssh
-          frc_v = 0._wp                                           
-          frc_t = 0._wp                                           
-          frc_s = 0._wp                                                  
+          frc_v = 0._dp                                           
+          frc_t = 0._dp                                           
+          frc_s = 0._dp                                                  
        ENDIF
 
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 4162)
@@ -108,15 +108,18 @@
             ncsi1(2)   =  97  ;  ncsj1(2)   = 107
             ncsi2(2)   = 103  ;  ncsj2(2)   = 111
-            ncsir(2,1) = 110  ;  ncsjr(2,1) = 111
-            !                                            ! Black Sea 1 : west part of the Black Sea 
-            ncsnr(3)   = 1    ; ncstt(3)   =   2            !            (ie west of the cyclic b.c.)
-            ncsi1(3)   = 174  ; ncsj1(3)   = 107            ! put in Med Sea
-            ncsi2(3)   = 181  ; ncsj2(3)   = 112
-            ncsir(3,1) = 171  ; ncsjr(3,1) = 106 
-            !                                            ! Black Sea 2 : est part of the Black Sea 
-            ncsnr(4)   =   1  ;  ncstt(4)   =   2           !               (ie est of the cyclic b.c.)
-            ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! put in Med Sea
-            ncsi2(4)   =   6  ;  ncsj2(4)   = 112
-            ncsir(4,1) = 171  ;  ncsjr(4,1) = 106 
+            ncsir(2,1) = 110  ;  ncsjr(2,1) = 111           
+            !                                            ! Black Sea (crossed by the cyclic boundary condition)
+            ncsnr(3:4) =   4  ;  ncstt(3:4) =   2           ! put in Med Sea (north of Aegean Sea)
+            ncsir(3:4,1) = 171;  ncsjr(3:4,1) = 106         !
+            ncsir(3:4,2) = 170;  ncsjr(3:4,2) = 106 
+            ncsir(3:4,3) = 171;  ncsjr(3:4,3) = 105 
+            ncsir(3:4,4) = 170;  ncsjr(3:4,4) = 105 
+            ncsi1(3)   = 174  ;  ncsj1(3)   = 107           ! 1 : west part of the Black Sea      
+            ncsi2(3)   = 181  ;  ncsj2(3)   = 112           !            (ie west of the cyclic b.c.)
+            ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! 2 : east part of the Black Sea 
+            ncsi2(4)   =   6  ;  ncsj2(4)   = 112           !           (ie east of the cyclic b.c.)
+             
+          
+
             !                                        ! =======================
          CASE ( 4 )                                  !  ORCA_R4 configuration
@@ -372,6 +375,5 @@
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array)
       !
-      INTEGER  ::   jc, jn      ! dummy loop indices
-      INTEGER  ::   ii, ij      ! temporary integer
+      INTEGER  ::   jc, jn, ji, jj      ! dummy loop indices
       !!----------------------------------------------------------------------
       !
@@ -379,7 +381,9 @@
          IF( ncstt(jc) >= 1 ) THEN            ! runoff mask set to 1 at closed sea outflows
              DO jn = 1, 4
-               ii = mi0( ncsir(jc,jn) )
-               ij = mj0( ncsjr(jc,jn) )
-               p_rnfmsk(ii,ij) = MAX( p_rnfmsk(ii,ij), 1.0_wp )
+                DO jj =    mj0( ncsjr(jc,jn) ), mj1( ncsjr(jc,jn) )
+                   DO ji = mi0( ncsir(jc,jn) ), mi1( ncsir(jc,jn) )
+                      p_rnfmsk(ji,jj) = MAX( p_rnfmsk(ji,jj), 1.0_wp )
+                   END DO
+                END DO
             END DO 
          ENDIF 
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 4162)
@@ -238,4 +238,9 @@
                nday_year = 1
                nsec_year = ndt05
+               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value
+                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   &
+                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', &
+                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' )
+               ENDIF
                nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1)
                IF( nleapy == 1 )   CALL day_mth
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4162)
@@ -2186,7 +2186,7 @@
         IF(((nbondi .ne. 0) .AND. (ktype .eq. 2)) .OR. ((nbondj .ne. 0) .AND. (ktype .eq. 1))) THEN
             ! there is nothing to be migrated
-               lmigr = .FALSE.
+              lmigr = .TRUE.
             ELSE
-              lmigr = .TRUE.
+              lmigr = .FALSE.
             ENDIF
 
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 4162)
@@ -187,5 +187,5 @@
          &      gsinf(jpi,jpj), gcosf(jpi,jpj), STAT=ierr )
       IF(lk_mpp)   CALL mpp_sum( ierr )
-      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+      IF( ierr /= 0 )   CALL ctl_stop('angle: unable to allocate arrays' )
 
       ! ============================= !
@@ -361,5 +361,5 @@
             &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
          IF( lk_mpp    )   CALL mpp_sum( ierr )
-         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+         IF( ierr /= 0 )   CALL ctl_stop('geo2oce: unable to allocate arrays' )
       ENDIF
 
@@ -438,9 +438,9 @@
       !!----------------------------------------------------------------------
 
-      IF( ALLOCATED( gsinlon ) ) THEN
+      IF( .NOT. ALLOCATED( gsinlon ) ) THEN
          ALLOCATE( gsinlon(jpi,jpj,4) , gcoslon(jpi,jpj,4) ,   &
             &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
          IF( lk_mpp    )   CALL mpp_sum( ierr )
-         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+         IF( ierr /= 0 )   CALL ctl_stop('oce2geo: unable to allocate arrays' )
       ENDIF
 
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 4162)
@@ -373,5 +373,5 @@
       !
       IF( TRIM( sn_rcv_tau%cldes ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used
-         srcv(jpr_itz1:jpr_itz2)%laction = .FALSE.    ! ice components not received (itx1 and ity1 used later)
+         srcv(jpr_itx1:jpr_itz2)%laction = .FALSE.    ! ice components not received
          srcv(jpr_itx1)%clgrid = 'U'                  ! ocean stress used after its transformation
          srcv(jpr_ity1)%clgrid = 'V'                  ! i.e. it is always at U- & V-points for i- & j-comp. resp.
@@ -392,5 +392,7 @@
       SELECT CASE( TRIM( sn_rcv_emp%cldes ) )
       CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE. 
-      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
+      CASE( 'conservative'  )
+         srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
+         IF ( k_ice <= 1 )  srcv(jpr_ivep)%laction = .FALSE.
       CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE.
       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' )
@@ -450,13 +452,4 @@
          CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between sn_rcv_qns%cldes and sn_rcv_dqnsdt%cldes' )
       !                                                      ! ------------------------- !
-      !                                                      !    Ice Qsr penetration    !   
-      !                                                      ! ------------------------- !
-      ! fraction of net shortwave radiation which is not absorbed in the thin surface layer 
-      ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
-      ! Coupled case: since cloud cover is not received from atmosphere 
-      !               ===> defined as constant value -> definition done in sbc_cpl_init
-      IF ( ALLOCATED (fr1_i0)) fr1_i0 (:,:) = 0.18
-      IF ( ALLOCATED (fr2_i0)) fr2_i0 (:,:) = 0.82
-      !                                                      ! ------------------------- !
       !                                                      !      10m wind module      !   
       !                                                      ! ------------------------- !
@@ -493,4 +486,9 @@
       ! Allocate taum part of frcv which is used even when not received as coupling field
       IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jn)%nct) )
+      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.
+      IF( k_ice /= 0 ) THEN
+         IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jn)%nct) )
+         IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jn)%nct) )
+      END IF
 
       ! ================================ !
@@ -1316,4 +1314,13 @@
       END SELECT
 
+      !    Ice Qsr penetration used (only?)in lim2 or lim3 
+      ! fraction of net shortwave radiation which is not absorbed in the thin surface layer 
+      ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
+      ! Coupled case: since cloud cover is not received from atmosphere 
+      !               ===> defined as constant value -> definition done in sbc_cpl_init
+      fr1_i0(:,:) = 0.18
+      fr2_i0(:,:) = 0.82
+
+
       CALL wrk_dealloc( jpi,jpj, zcptn, ztmp, zicefr )
       !
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4162)
@@ -675,5 +675,5 @@
 
 
-   FUNCTION tfreez( psal ) RESULT( ptf )
+   FUNCTION tfreez( psal, pdep ) RESULT( ptf )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE eos_init  ***
@@ -688,4 +688,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   psal   ! salinity             [psu]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [decibars]
       ! Leave result array automatic rather than making explicitly allocated
       REAL(wp), DIMENSION(jpi,jpj)                ::   ptf    ! freezing temperature [Celcius]
@@ -694,4 +695,7 @@
       ptf(:,:) = ( - 0.0575_wp + 1.710523e-3_wp * SQRT( psal(:,:) )   &
          &                     - 2.154996e-4_wp *       psal(:,:)   ) * psal(:,:)
+      IF ( PRESENT( pdep ) ) THEN   
+         ptf(:,:) = ptf(:,:) - 7.53e-4_wp * pdep(:,:)
+      ENDIF
       !
    END FUNCTION tfreez
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/SAS_SRC/daymod.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 4162)
@@ -246,4 +246,9 @@
                nday_year = 1
                nsec_year = ndt05
+               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value
+                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   &
+                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', &
+                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' )
+               ENDIF
                nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1)
                IF( nleapy == 1 )   CALL day_mth
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4162)
@@ -82,5 +82,5 @@
       IF( nn_timing == 1 )  CALL timing_start('p4z_sed')
       !
-      IF( kt == nit000 .AND. jnt == 1 )  THEN
+      IF( kt == nittrc000 .AND. jnt == 1 )  THEN
          ryyss    = nyear_len(1) * rday    ! number of seconds per year and per month
          rmtss    = ryyss / raamo
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4162)
@@ -291,5 +291,4 @@
    END SUBROUTINE p4z_ph_ini
 
-
    SUBROUTINE p4z_rst( kt, cdrw )
       !!---------------------------------------------------------------------
@@ -320,5 +319,5 @@
          ELSE
 !            hi(:,:,:) = 1.e-9 
-           CALL p4z_ph_ini
+            CALL p4z_ph_ini
          ENDIF
          CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:) )
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 4162)
@@ -160,5 +160,4 @@
          xksi(:,:)    = 2.e-6
          xksimax(:,:) = xksi(:,:)
-         !
       END IF
 
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh	(revision 4162)
@@ -40,5 +40,5 @@
 # ::
 #
-#  $ ./Fcheck_archfile.sh ARCHFILE COMPILER
+#  $ ./Fcheck_archfile.sh ARCHFILE CPPFILE COMPILER
 #
 #
@@ -94,13 +94,16 @@
 	else
 	    if [ -f ${COMPIL_DIR}/$1 ]; then
-		# has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
-		mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
-		if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
-		    echo $mycpp > ${COMPIL_DIR}/cpp.history
-		    cpeval ${myarch} ${COMPIL_DIR}/$1
+		if [ "$2" != "nocpp" ] 
+		then
+		    # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
+		    mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
+		    if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
+			echo $mycpp > ${COMPIL_DIR}/cpp.history
+			cpeval ${myarch} ${COMPIL_DIR}/$1
+		    fi
+		    # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
+		    mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
+		    [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
 		fi
-		# has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
-		mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
-		[ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
 		# has myarch file been updated since we copied it in ${COMPIL_DIR}?
 		myarchdir=$( dirname ${myarch} )
@@ -134,13 +137,16 @@
     if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then 
 	if [ -f ${COMPIL_DIR}/$1 ]; then
-	    # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
-	    mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
-	    if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
-		echo $mycpp > ${COMPIL_DIR}/cpp.history
-		cpeval ${myarch} ${COMPIL_DIR}/$1
+	    if [ "$2" != "nocpp" ] 
+	    then
+		# has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
+		mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
+		if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
+		    echo $mycpp > ${COMPIL_DIR}/cpp.history
+		    cpeval ${myarch} ${COMPIL_DIR}/$1
+		fi
+		# has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
+		mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
+		[ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
 	    fi
-	    # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
-	    mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
-	    [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
 	    # has myarch file been updated since we copied it in ${COMPIL_DIR}?
 	    myarch=$( find -L ${MAIN_DIR}/ARCH -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print )
@@ -150,5 +156,8 @@
 	fi
     else
-	ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history
+	if [ "$2" != "nocpp" ] 
+	then
+	    ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history
+	fi
 	echo ${myarch} > ${COMPIL_DIR}/arch.history
 	cpeval ${myarch} ${COMPIL_DIR}/$1
@@ -157,5 +166,10 @@
 
 #- do we need xios library?
-use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput )
+if [ "$2" != "nocpp" ] 
+then
+    use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput )
+else
+    use_iom=0
+fi
 have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" )
 if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]]
@@ -166,5 +180,10 @@
 
 #- do we need oasis libraries?
-use_oasis=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_oasis3 )
+if [ "$2" != "nocpp" ] 
+then
+    use_oasis=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_oasis3 )
+else
+    use_oasis=0
+fi
 for liboa in psmile.MPI1 mct mpeu scrip mpp_io
 do
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4162)
@@ -59,13 +59,13 @@
 #------------------------------------------------
 #
-external=$( grep -c "<field_definition.* src=" $xmlfile )
+external=$( grep -c "<field_definition  *\([^ ].* \)*src=" $xmlfile )
 if [ $external -eq 1 ]
 then
-    xmlfield_def=$( grep "<field_definition.* src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' )
+    xmlfield_def=$( grep "<field_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' )
     xmlfield_def=$( dirname $xmlfile )/$xmlfield_def   
 else
     xmlfield_def=$xmlfile
 fi
-[ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfield_def
+[ $inxml -eq 1 ] && grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def
 [ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \;
 [ $(( $insrc + $inxml )) -ge 1 ] && exit
@@ -91,9 +91,9 @@
 # list of variables defined in the xml file
 #
-varlistxml=$( grep "< *field.* id *=" $xmlfield_def  | sed -e "s/^.*< *field.* id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistxml=$( grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def  | sed -e "s/^.*< *field .*id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 # list of variables to be outputed in the xml file
 #
-varlistout=$( grep "< *field.* field_ref *=" $xmlfile  | sed -e "s/^.*< *field.* field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 echo "--------------------------------------------------"
Index: /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/maketools
===================================================================
--- /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/maketools	(revision 4161)
+++ /branches/2013/dev_LOCEAN_2013/NEMOGCM/TOOLS/maketools	(revision 4162)
@@ -146,5 +146,5 @@
 
 #- When used for the first time, choose a compiler ---
-. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm ${CMP_NAM} || exit
+. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm nocpp ${CMP_NAM} || exit
 
 #- Choose a default tool if needed ---
