Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 6468)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 6469)
@@ -24,4 +24,5 @@
    USE par_oce          ! ocean parameters
    USE dom_ice          ! sea-ice domain
+   USE limvar           ! lim_var_salprof
    USE in_out_manager   ! I/O manager
    USE lib_mpp          ! MPP library
@@ -337,4 +338,10 @@
          END DO
       END DO
+
+      ! for constant salinity in time
+      IF( nn_icesal == 1 .OR. nn_icesal == 3 )  THEN
+         CALL lim_var_salprof
+         smv_i = sm_i * v_i
+      ENDIF
 
       ! Snow temperature and heat content
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 6468)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 6469)
@@ -651,4 +651,11 @@
             wfx_dyn(ji,jj) = wfx_dyn(ji,jj) - vsw (ij) * rhoic * r1_rdtice   ! increase in ice volume due to seawater frozen in voids
             
+             ! virtual salt flux to keep salinity constant
+            IF( nn_icesal == 1 .OR. nn_icesal == 3 )  THEN
+               srdg2(ij)      = srdg2(ij) - vsw(ij) * ( sss_m(ji,jj) - sm_i(ji,jj,jl1) )           ! ridge salinity = sm_i
+               sfx_bri(ji,jj) = sfx_bri(ji,jj) + sss_m(ji,jj)    * vsw(ij) * rhoic * r1_rdtice  &  ! put back sss_m into the ocean
+                  &                            - sm_i(ji,jj,jl1) * vsw(ij) * rhoic * r1_rdtice     ! and get  sm_i  from the ocean 
+            ENDIF
+
             !------------------------------------------            
             ! 3.7 Put the snow somewhere in the ocean
@@ -664,5 +671,5 @@
             hfx_dyn(ji,jj) = hfx_dyn(ji,jj) + ( - esrdg(ij) * ( 1._wp - rn_fsnowrdg )         & 
                &                                - esrft(ij) * ( 1._wp - rn_fsnowrft ) ) * r1_rdtice        ! heat sink for ocean (<0, W.m-2)
-
+               
             !-----------------------------------------------------------------
             ! 3.8 Compute quantities used to apportion ice among categories
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90	(revision 6468)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90	(revision 6469)
@@ -116,7 +116,7 @@
 
       ! Discriminate between varying salinity (nn_icesal=2) and prescribed cases (other values)
-      SELECT CASE( nn_icesal )                       ! varying salinity or not
-         CASE( 1, 3, 4 ) ;   zswitch_sal = 0       ! prescribed salinity profile
-         CASE( 2 )       ;   zswitch_sal = 1       ! varying salinity profile
+      SELECT CASE( nn_icesal )                  ! varying salinity or not
+         CASE( 1, 3 ) ;   zswitch_sal = 0       ! prescribed salinity profile
+         CASE( 2 )    ;   zswitch_sal = 1       ! varying salinity profile
       END SELECT
 
@@ -651,5 +651,4 @@
 
          ! Contribution to energy flux to the ocean [J/m2], >0 (if sst<0)
-         ii = MOD( npb(ji) - 1, jpi ) + 1 ; ij = ( npb(ji) - 1 ) / jpi + 1
          zfmdt          = ( rhosn - rhoic ) * MAX( dh_snowice(ji), 0._wp )    ! <0
          zsstK          = sst_m(ii,ij) + rt0                                
@@ -662,4 +661,10 @@
          ! Contribution to salt flux
          sfx_sni_1d(ji) = sfx_sni_1d(ji) + sss_m(ii,ij) * a_i_1d(ji) * zfmdt * r1_rdtice 
+
+         ! virtual salt flux to keep salinity constant
+         IF( nn_icesal == 1 .OR. nn_icesal == 3 )  THEN
+            sfx_bri_1d(ji) = sfx_bri_1d(ji) - sss_m(ii,ij) * a_i_1d(ji) * zfmdt                  * r1_rdtice  & ! put back sss_m into the ocean
+               &                            - sm_i_1d(ji)  * a_i_1d(ji) * dh_snowice(ji) * rhoic * r1_rdtice    ! and get  sm_i  from the ocean 
+         ENDIF
           
          ! Contribution to mass flux
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 6468)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 6469)
@@ -62,18 +62,12 @@
       END DO
  
-      !------------------------------------------------------------------------------|
-      ! 1) Constant salinity, constant in time                                       |
-      !------------------------------------------------------------------------------|
-!!gm comment: if nn_icesal = 1 s_i_new, s_i_1d and sm_i_1d can be set to rn_icesal one for all in the initialisation phase !!
-!!gm           ===>>>   simplification of almost all test on nn_icesal value
-      IF(  nn_icesal == 1  ) THEN
-            s_i_1d (kideb:kiut,1:nlay_i) =  rn_icesal
-            sm_i_1d(kideb:kiut)          =  rn_icesal 
-            s_i_new(kideb:kiut)          =  rn_icesal
-      ENDIF
+      !--------------------------------------------------------------------|
+      ! 1) salinity constant in time                                       |
+      !--------------------------------------------------------------------|
+      ! do nothing
 
-      !------------------------------------------------------------------------------|
-      !  Module 2 : Constant salinity varying in time                                |
-      !------------------------------------------------------------------------------|
+      !----------------------------------------------------------------------|
+      !  2) salinity varying in time                                         |
+      !----------------------------------------------------------------------|
       IF(  nn_icesal == 2  ) THEN
 
@@ -113,5 +107,5 @@
 
       !------------------------------------------------------------------------------|
-      !  Module 3 : Profile of salinity, constant in time                            |
+      !  3) vertical profile of salinity, constant in time                           |
       !------------------------------------------------------------------------------|
       IF(  nn_icesal == 3  )   CALL lim_var_salprof1d( kideb, kiut )
Index: /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90
===================================================================
--- /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90	(revision 6468)
+++ /branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90	(revision 6469)
@@ -314,5 +314,8 @@
       ! Vertically constant, constant in time
       !---------------------------------------
-      IF(  nn_icesal == 1  )   s_i(:,:,:,:) = rn_icesal
+      IF(  nn_icesal == 1  )  THEN
+         s_i (:,:,:,:) = rn_icesal
+         sm_i(:,:,:)   = rn_icesal
+      ENDIF
 
       !-----------------------------------
