Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg	(revision 8291)
@@ -20,12 +20,7 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------  
-   ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time
+   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time
    nn_closea   =    0      !  remove (=0) or keep (=1) closed seas and lakes (ORCA)
    !
@@ -176,4 +171,5 @@
 &namdyn_hpg    !   Hydrostatic pressure gradient option
 !-----------------------------------------------------------------------
+   ln_hpg_sco  = .true.   !  s-coordinate (standard jacobian formulation)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg	(revision 8291)
@@ -17,9 +17,4 @@
       !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules
       cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename
-/
-!-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/file_def_nemo.xml
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/file_def_nemo.xml	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/file_def_nemo.xml	(revision 8291)
@@ -21,7 +21,7 @@
     -->
     
-    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
-      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+      <file_group id="2ts" output_freq="2ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
 
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -39,5 +39,5 @@
       <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->
       
-      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
 	
 	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
@@ -110,162 +110,7 @@
 
 	<file id="file6" name_suffix="_icemod" description="ice variables" enabled=".true." >
-          <field field_ref="snowthic_cea"    name="snthic" />
-          <field field_ref="icethic_cea"     name="sithic" />
           <field field_ref="icevolu"         name="sivolu" />
-          <field field_ref="snowvol"         name="snvolu" />
-          <field field_ref="iceconc"         name="siconc" />
-
-          <field field_ref="vfxbog"          name="vfxbog" />
-          <field field_ref="vfxdyn"          name="vfxdyn" />
-          <field field_ref="vfxopw"          name="vfxopw" />
-          <field field_ref="vfxsni"          name="vfxsni" />
-          <field field_ref="vfxsum"          name="vfxsum" />
-          <field field_ref="vfxbom"          name="vfxbom" />
-          <field field_ref="vfxres"          name="vfxres" />
-          <field field_ref="vfxice"          name="vfxice" />
-          <field field_ref="vfxsnw"          name="vfxsnw" />
-          <field field_ref="vfxsub"          name="vfxsub" />
-          <field field_ref="vfxspr"          name="vfxspr" />
-
-          <field field_ref="icetrp"          name="sivtrp" />
-          <field field_ref="snwtrp"          name="snvtrp" />
-          <field field_ref="saltrp"          name="saltrp" />
-          <field field_ref="deitrp"          name="deitrp" />
-          <field field_ref="destrp"          name="destrp" />
-
-          <field field_ref="sfxbri"          name="sfxbri" />
-          <field field_ref="sfxdyn"          name="sfxdyn" />
-          <field field_ref="sfxres"          name="sfxres" />
-          <field field_ref="sfxbog"          name="sfxbog" />
-          <field field_ref="sfxbom"          name="sfxbom" />
-          <field field_ref="sfxsum"          name="sfxsum" />
-          <field field_ref="sfxsni"          name="sfxsni" />
-          <field field_ref="sfxopw"          name="sfxopw" />
-          <field field_ref="sfx"             name="sfx"    />
-
-          <field field_ref="hfxsum"          name="hfxsum"     />
-          <field field_ref="hfxbom"          name="hfxbom"     />
-          <field field_ref="hfxbog"          name="hfxbog"     />
-          <field field_ref="hfxdif"          name="hfxdif"     />
-          <field field_ref="hfxopw"          name="hfxopw"     />
-          <field field_ref="hfxout"          name="hfxout"     />
-          <field field_ref="hfxin"           name="hfxin"      />
-          <field field_ref="hfxsnw"          name="hfxsnw"     />
-          <field field_ref="hfxerr"          name="hfxerr"     />
-          <field field_ref="hfxerr_rem"      name="hfxerr_rem" />
-
-	  <!-- ice-ocean heat flux from mass exchange -->
-          <field field_ref="hfxdyn"          name="hfxdyn" />
-          <field field_ref="hfxres"          name="hfxres" />
-          <field field_ref="hfxthd"          name="hfxthd" />
-	  <!-- ice-atm. heat flux from mass exchange -->
-          <field field_ref="hfxsub"          name="hfxsub" />
-          <field field_ref="hfxspr"          name="hfxspr" />
-
-	  <!-- diags -->
-          <field field_ref="hfxdhc"          name="hfxdhc" />
-          <field field_ref="hfxtur"          name="hfxtur" />
-
-          <field field_ref="isst"            name="sst"    />
-          <field field_ref="isss"            name="sss"    />
-          <field field_ref="micesalt"        name="sisali" />
-          <field field_ref="micet"           name="sitemp" />
-          <field field_ref="icest"           name="sistem" />
-          <field field_ref="icehc"           name="siheco" />
-          <field field_ref="isnowhc"         name="snheco" />
-          <field field_ref="miceage"         name="siages" />
-
-          <field field_ref="uice_ipa"        name="sivelu" />
-          <field field_ref="vice_ipa"        name="sivelv" />
-          <field field_ref="icevel"          name="sivelo" />
-          <field field_ref="idive"           name="sidive" />
-          <field field_ref="ishear"          name="sishea" />
-          <field field_ref="icestr"          name="sistre" />
-
-          <field field_ref="ibrinv"          name="sibrin" />
-          <field field_ref="icecolf"         name="sicolf" />
-
-          <field field_ref="iceage_cat"      name="siagecat" />
-          <field field_ref="iceconc_cat"     name="siconcat" />
-          <field field_ref="icethic_cat"     name="sithicat" />
-          <field field_ref="snowthic_cat"    name="snthicat" />
-          <field field_ref="salinity_cat"    name="salincat" />
-          <field field_ref="brinevol_cat"    name="sibricat" />
-	  <field field_ref="icetemp_cat"     name="sitemcat" />
-	  <field field_ref="snwtemp_cat"     name="sntemcat" />
 
 	</file>
-
-        <file id="file7" name_suffix="_scalar" description="scalar variables" enabled=".true." >
-          <field field_ref="voltot"       name="scvoltot"   />
-          <field field_ref="sshtot"       name="scsshtot"   />
-          <field field_ref="sshsteric"    name="scsshste"   />
-          <field field_ref="sshthster"    name="scsshtst"   />
-          <field field_ref="masstot"      name="scmastot"   />
-          <field field_ref="temptot"      name="sctemtot"   />
-          <field field_ref="saltot"       name="scsaltot"   />
-
-          <field field_ref="bgtemper"     name="bgtemper"   />
-          <field field_ref="bgsaline"     name="bgsaline"   />
-          <field field_ref="bgheatco"     name="bgheatco"   />
-          <field field_ref="bgsaltco"     name="bgsaltco"   />
-          <field field_ref="bgvolssh"     name="bgvolssh"   /> 
-          <field field_ref="bgvole3t"     name="bgvole3t"   />
-          <field field_ref="bgfrcvol"     name="bgfrcvol"   />
-          <field field_ref="bgfrctem"     name="bgfrctem"   />
-          <field field_ref="bgfrcsal"     name="bgfrcsal"   />
-
-          <field field_ref="ibgvoltot"    name="ibgvoltot"  />
-          <field field_ref="sbgvoltot"    name="sbgvoltot"  />
-          <field field_ref="ibgarea"      name="ibgarea"    />
-          <field field_ref="ibgsaline"    name="ibgsaline"  />
-          <field field_ref="ibgtemper"    name="ibgtemper"  />
-          <field field_ref="ibgheatco"    name="ibgheatco"  />
-          <field field_ref="sbgheatco"    name="sbgheatco"  />
-          <field field_ref="ibgsaltco"    name="ibgsaltco"  />
-
-          <field field_ref="ibgvfx"       name="ibgvfx"     />
-          <field field_ref="ibgvfxbog"    name="ibgvfxbog"  />
-          <field field_ref="ibgvfxopw"    name="ibgvfxopw"  />
-          <field field_ref="ibgvfxsni"    name="ibgvfxsni"  />
-          <field field_ref="ibgvfxdyn"    name="ibgvfxdyn"  />
-          <field field_ref="ibgvfxbom"    name="ibgvfxbom"  />
-          <field field_ref="ibgvfxsum"    name="ibgvfxsum"  />
-          <field field_ref="ibgvfxres"    name="ibgvfxres"  />
-          <field field_ref="ibgvfxspr"    name="ibgvfxspr"  />
-          <field field_ref="ibgvfxsnw"    name="ibgvfxsnw"  />
-          <field field_ref="ibgvfxsub"    name="ibgvfxsub"  />
-
-          <field field_ref="ibgsfx"       name="ibgsfx"     />
-          <field field_ref="ibgsfxbri"    name="ibgsfxbri"  />
-          <field field_ref="ibgsfxdyn"    name="ibgsfxdyn"  />
-          <field field_ref="ibgsfxres"    name="ibgsfxres"  />
-          <field field_ref="ibgsfxbog"    name="ibgsfxbog"  />
-          <field field_ref="ibgsfxopw"    name="ibgsfxopw"  />
-          <field field_ref="ibgsfxsni"    name="ibgsfxsni"  />
-          <field field_ref="ibgsfxbom"    name="ibgsfxbom"  />
-          <field field_ref="ibgsfxsum"    name="ibgsfxsum"  />
-
-          <field field_ref="ibghfxdhc"    name="ibghfxdhc"  />
-          <field field_ref="ibghfxspr"    name="ibghfxspr"  />
-
-          <field field_ref="ibghfxres"    name="ibghfxres"  />
-          <field field_ref="ibghfxsub"    name="ibghfxsub"  />
-          <field field_ref="ibghfxdyn"    name="ibghfxdyn"  />
-          <field field_ref="ibghfxthd"    name="ibghfxthd"  />
-          <field field_ref="ibghfxsum"    name="ibghfxsum"  />
-          <field field_ref="ibghfxbom"    name="ibghfxbom"  />
-          <field field_ref="ibghfxbog"    name="ibghfxbog"  />
-          <field field_ref="ibghfxdif"    name="ibghfxdif"  />
-          <field field_ref="ibghfxopw"    name="ibghfxopw"  />
-          <field field_ref="ibghfxout"    name="ibghfxout"  />
-          <field field_ref="ibghfxin"     name="ibghfxin"   />
-          <field field_ref="ibghfxsnw"    name="ibghfxsnw"  />
-
-          <field field_ref="ibgfrcvol"    name="ibgfrcvol"  />
-          <field field_ref="ibgfrcsfx"    name="ibgfrcsfx"  />
-          <field field_ref="ibgvolgrm"    name="ibgvolgrm"  />
-
-        </file>
 
 	<!--
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg	(revision 8291)
@@ -19,9 +19,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
@@ -81,5 +76,4 @@
 &nambbc        !   bottom temperature boundary condition                (default: NO)
 !-----------------------------------------------------------------------
-   ln_trabbc   = .true.    !  Apply a geothermal heating at the ocean bottom
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/field_def_nemo-lim.xml
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/field_def_nemo-lim.xml	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/field_def_nemo-lim.xml	(revision 8291)
@@ -232,4 +232,9 @@
          <field id="e3t_m"    unit="m"    />
          <field id="frq_m"    unit="-"    />
+
+         <!-- specific for rheology -->
+         <field id="isig1"        long_name="1st principal stress component for EVP rhg"                   unit="unitless" />
+         <field id="isig2"        long_name="2nd principal stress component for EVP rhg"                   unit="unitless" />
+         <field id="isig3"        long_name="convergence measure for EVP rheology (must be =1)"            unit="unitless" />
 
       </field_group>
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 8291)
@@ -313,6 +313,6 @@
 !              !             !  (if <0  months)  !   name    !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
    l_sasread   = .TRUE.   ! Read fields in a file if .TRUE. , or initialize to 0. in sbcssm.F90 if .FALSE.
-   sn_usp      = 'sas_grid_U',     120           , 'vozocrtx',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
-   sn_vsp      = 'sas_grid_V',     120           , 'vomecrty',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
+   sn_usp      = 'sas_grid_U',     120           ,    'uos'  ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
+   sn_vsp      = 'sas_grid_V',     120           ,    'vos'  ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
    sn_tem      = 'sas_grid_T',     120           , 'sosstsst',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
    sn_sal      = 'sas_grid_T',     120           , 'sosaline',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
@@ -321,5 +321,5 @@
    sn_frq      = 'sas_grid_T',     120           , 'frq_m'   ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    ''
 
-   ln_3d_uve   = .true.    !  specify whether we are supplying a 3D u,v and e3 field
+   ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field
    ln_read_frq = .false.   !  specify whether we must read frq or not
    cn_dir      = './'      !  root directory for the location of the bulk files are
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg	(revision 8291)
@@ -26,5 +26,5 @@
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
-   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time
+   ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time
    !
    nn_msh      =    1      !  create (>0) a mesh file or not (=0)
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h	(revision 8291)
@@ -36,5 +36,5 @@
 #define LONG_FNAME 1000		// Max length for a file name
 #define LONG_C     200
-#define LONG_M     1500
+#define LONG_M     2500
 
 #define NB_CAT_VARIABLES 5
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/ice.F90
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 8291)
@@ -640,5 +640,5 @@
                 diag_intstrx(jpi,jpj) , diag_intstry(jpi,jpj) ,    &
                 diag_sig1(jpi,jpj)    , diag_sig2(jpi,jpj)    ,    &
-                STAT = ierr(ii) )
+                diag_shear(jpi,jpj)   , STAT = ierr(ii) )
 
       ice_alloc = MAXVAL( ierr(:) )
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 8291)
@@ -531,5 +531,5 @@
       INTEGER :: ifpr, ierror
       !
-      CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ice files
+      CHARACTER(len=256) ::  cn_dir          ! Root directory for location of ice files
       TYPE(FLD_N)                    ::   sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi
       TYPE(FLD_N), DIMENSION(jpfldi) ::   slf_i                 ! array of namelist informations on the fields to read
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90	(revision 8291)
@@ -54,8 +54,10 @@
       INTEGER  ::  ji, jj, jk, jl  ! dummy loop indices
       REAL(wp) ::  z2da, z2db, ztmp, zrho1, zrho2, zmiss_val
+      REAL(wp) ::  zs12, zshear
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zswi2, zmiss2
       REAL(wp), POINTER, DIMENSION(:,:)   ::  z2d, zswi, zmiss !  2D workspace
       REAL(wp), POINTER, DIMENSION(:,:)   ::  zfb              ! ice freeboard
       REAL(wp), POINTER, DIMENSION(:,:)   ::  zamask, zamask15 ! 15% concentration mask
+      REAL(wp), POINTER, DIMENSION(:,:)   ::  zsig1, zsig2, zsig3
 
       ! Global ice diagnostics (SIMIP)
@@ -71,7 +73,8 @@
       IF( nn_timing == 1 )  CALL timing_start('limwri')
 
-      CALL wrk_alloc( jpi, jpj, jpl, zswi2, zmiss2 )
-      CALL wrk_alloc( jpi, jpj     , z2d, zswi, zmiss )
-      CALL wrk_alloc( jpi, jpj     , zfb, zamask, zamask15 )
+      CALL wrk_alloc( jpi,jpj, jpl, zswi2, zmiss2 )
+      CALL wrk_alloc( jpi,jpj     , z2d, zswi, zmiss )
+      CALL wrk_alloc( jpi,jpj     , zfb, zamask, zamask15 )
+      CALL wrk_alloc( jpi,jpj     , zsig1, zsig2, zsig3 )
 
       !----------------------------------------
@@ -226,4 +229,32 @@
       CALL iom_put ('hfxspr'     , hfx_spr(:,:)         )   ! Heat content of snow precip 
 
+      ! specific outputs for EVP rheology
+      IF( iom_use( "isig1" ) .OR. iom_use( "isig2" ) .OR. iom_use( "isig3" ) ) THEN
+         zsig1(:,:) = 0._wp; zsig2(:,:) = 0._wp; zsig3(:,:) = 0._wp;
+         DO jj = 2, jpjm1
+            DO ji = 2, jpim1
+               zs12 = ( zswi(ji-1,jj) * stress12_i(ji-1,jj) + zswi(ji  ,jj-1) * stress12_i(ji  ,jj-1) +  &  ! stress12_i at T-point
+                  &     zswi(ji  ,jj) * stress12_i(ji  ,jj) + zswi(ji-1,jj-1) * stress12_i(ji-1,jj-1) )  &
+                  &   / MAX( 1._wp, zswi(ji-1,jj) + zswi(ji,jj-1) + zswi(ji,jj) + zswi(ji-1,jj-1) )
+
+               zshear = SQRT( stress2_i(ji,jj) * stress2_i(ji,jj) + 4._wp * zs12 * zs12 ) ! shear stress  
+
+               z2da = zswi(ji,jj) / MAX( 1._wp, strength(ji,jj) )
+
+!!               zsig1(ji,jj) = 0.5_wp * z2da * ( stress1_i(ji,jj) + zshear ) ! principal stress (y-direction, see Hunke & Dukowicz 2002)
+!!               zsig2(ji,jj) = 0.5_wp * z2da * ( stress1_i(ji,jj) - zshear ) ! principal stress (x-direction, see Hunke & Dukowicz 2002)
+!!               zsig3(ji,jj) = z2da**2 * ( ( stress1_i(ji,jj) + strength(ji,jj) )**2 + ( rn_ecc * zshear )**2 ) ! quadratic relation linking compressive stress to shear stress
+!!                                                                                                               ! (scheme converges if this value is ~1, see Bouillon et al 2009 (eq. 11))
+               zsig1(ji,jj) = 0.5_wp * z2da * ( stress1_i(ji,jj) )          ! compressive stress, see Bouillon et al. 2015
+               zsig2(ji,jj) = 0.5_wp * z2da * ( zshear )                    ! shear stress
+               zsig3(ji,jj) = z2da**2 * ( ( stress1_i(ji,jj) + strength(ji,jj) )**2 + ( rn_ecc * zshear )**2 )
+            END DO
+         END DO
+         CALL lbc_lnk_multi( zsig1, 'T', 1., zsig2, 'T', 1., zsig3, 'T', 1. )
+         CALL iom_put( "isig1" , zsig1 )
+         CALL iom_put( "isig2" , zsig2 )
+         CALL iom_put( "isig3" , zsig3 )
+      ENDIF
+
       ! MV MP 2016
       IF ( ln_pnd ) THEN
@@ -400,4 +431,5 @@
       CALL wrk_dealloc( jpi, jpj     , z2d, zswi, zmiss )
       CALL wrk_dealloc( jpi, jpj     , zfb, zamask, zamask15 )
+      CALL wrk_dealloc( jpi, jpj     , zsig1, zsig2, zsig3 )
 
       IF( nn_timing == 1 )  CALL timing_stop('limwri')
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 8291)
@@ -179,4 +179,6 @@
                u_ice(:,:) = rn_uice * umask(:,:,1)             !     or prescribed velocity
                v_ice(:,:) = rn_vice * vmask(:,:,1)
+               !!CALL RANDOM_NUMBER(u_ice(:,:))
+               !!CALL RANDOM_NUMBER(v_ice(:,:))
             ENDIF
                                       CALL lim_trp( kt )       ! -- Ice transport (Advection/diffusion)
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 8291)
@@ -115,5 +115,5 @@
       ELSE
          sst_m(:,:) = 0._wp
-         sss_m(:,:) = 0._wp
+         sss_m(:,:) = 35._wp
          ssu_m(:,:) = 0._wp
          ssv_m(:,:) = 0._wp
Index: /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA
===================================================================
--- /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA	(revision 8290)
+++ /branches/2017/dev_r8183_ICEMODEL/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_ADA	(revision 8291)
@@ -11,5 +11,5 @@
 # @ total_tasks = NPROCS
 # time
-# @ wall_clock_limit = 1:30:00
+# @ wall_clock_limit = 00:59:00
 # @ queue
 
