Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_pisces_ref
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_pisces_ref	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_pisces_ref	(revision 5184)
@@ -371,2 +371,43 @@
    pisdiabio(17)  = 'SEDNO3' , 'NO3 remineralization from SED',  'mmole/m3/s'
 /
+!'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+&nampisice      !  Prescribed sea ice tracers
+!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+! constant ocean tracer concentrations are defined in trcice_pisces.F90 (Global, Arctic, Antarctic and Baltic)
+! trc_ice_ratio     * betw 0 and 1: prescribed ice/ocean tracer concentration ratio
+!                   * -1 => the ice-ocean tracer concentration ratio follows the 
+!                           ice-ocean salinity ratio
+!                   * -2 => tracer concentration in sea ice is prescribed and 
+!                           trc_ice_prescr is used
+! trc_ice_prescr    * prescribed tracer concentration used only if 
+!                     trc_ice_ratio = -2, or -99. if not used
+! cn_trc_o          * 'GL' use global ocean values making the Baltic distinction only
+!                     'AA' use Arctic/Antarctic contrast besides Baltic distinction
+!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+!    sn_tri_ ! trc_ice_ratio ! trc_ice_prescr !     cn_trc_o
+   sn_tri_dic =           -1.,           -99.,          'AA'
+   sn_tri_doc =            0.,           -99.,          'AA'
+   sn_tri_tal =           -1.,           -99.,          'AA'
+   sn_tri_oxy =           -1.,           -99.,          'GL'
+   sn_tri_cal =            0.,           -99.,          'GL'
+   sn_tri_po4 =           -1.,           -99.,          'AA'
+   sn_tri_poc =            0.,           -99.,          'GL'
+   sn_tri_goc =            0.,           -99.,          'GL'
+   sn_tri_bfe =            0.,           -99.,          'GL'
+   sn_tri_num =            0.,           -99.,          'GL'
+   sn_tri_sil =           -1.,           -99.,          'AA'
+   sn_tri_dsi =            0.,           -99.,          'GL'
+   sn_tri_gsi =            0.,           -99.,          'GL'
+   sn_tri_phy =            0.,           -99.,          'GL'
+   sn_tri_dia =            0.,           -99.,          'GL'
+   sn_tri_zoo =            0.,           -99.,          'GL'
+   sn_tri_mes =            0.,           -99.,          'GL'
+   sn_tri_fer =           -2.,          15E-9,          'AA'
+   sn_tri_sfe =            0.,           -99.,          'GL'
+   sn_tri_dfe =            0.,           -99.,          'GL'
+   sn_tri_nfe =            0.,           -99.,          'GL'
+   sn_tri_nch =            0.,           -99.,          'GL'
+   sn_tri_dch =            0.,           -99.,          'GL'
+   sn_tri_no3 =           -1.,           -99.,          'AA'
+   sn_tri_nh4 =            1.,           -99.,          'AA'
+/
Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_top_ref
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_top_ref	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/CONFIG/SHARED/namelist_top_ref	(revision 5184)
@@ -80,4 +80,11 @@
                            !                   =2 no damping in the mixed  layer (rho crieria)
    cn_resto_tr  = 'resto_tr.nc'    !  create a damping.coeff NetCDF file (=1) or not (=0)
+!-----------------------------------------------------------------------
+&namtrc_ice       !    Representation of sea ice growth & melt effects
+!-----------------------------------------------------------------------
+   nn_ice_tr   =  1        !  tracer concentration in sea ice 
+                           !    =-1 identical cc in ice and ocean (= old code)
+                           !    = 0 nil 
+                           !    = 1 prescribed to a namelist value (implemented in pisces only)
 /
 !-----------------------------------------------------------------------
Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 5184)
@@ -73,5 +73,5 @@
       CHARACTER (len=25) :: charout
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zpdep, zsidep, zwork1, zwork2, zwork3, zwork4
-      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zironice, zbureff
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zbureff
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zwsbio3, zwsbio4, zwscal
       REAL(wp), POINTER, DIMENSION(:,:,:) :: znitrpot, zirondep, zsoufer
@@ -97,29 +97,4 @@
       zwork3  (:,:) = 0.e0
       zwork4  (:,:) = 0.e0
-
-      ! Iron input/uptake due to sea ice : Crude parameterization based on Lancelot et al.
-      ! ----------------------------------------------------
-      IF( ln_ironice ) THEN  
-         !                                              
-         CALL wrk_alloc( jpi, jpj, zironice )
-         !                                              
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zdep    = rfact2 / fse3t(ji,jj,1)
-               zwflux  = fmmflx(ji,jj) / 1000._wp
-               zfminus = MIN( 0._wp, -zwflux ) * trn(ji,jj,1,jpfer) * zdep
-               zfplus  = MAX( 0._wp, -zwflux ) * icefeinput * zdep
-               zironice(ji,jj) =  zfplus + zfminus
-            END DO
-         END DO
-         !
-         trn(:,:,1,jpfer) = trn(:,:,1,jpfer) + zironice(:,:) 
-         ! 
-         IF( lk_iomput .AND. jnt == nrdttrc .AND. iom_use( "Ironice" ) )   &
-            &   CALL iom_put( "Ironice", zironice(:,:) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) ) ! iron flux from ice
-         !
-         CALL wrk_dealloc( jpi, jpj, zironice )
-         !                                              
-      ENDIF
 
       ! Add the external input of nutrients from dust deposition
Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 5184)
@@ -21,4 +21,6 @@
    USE trd_oce
    USE trdtra
+   USE sbc_oce
+   USE dom_oce
 
    IMPLICIT NONE
@@ -60,9 +62,11 @@
       INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
       !
-      INTEGER  ::   ji, jj, jn           ! dummy loop indices
-      REAL(wp) ::   zsrau, zse3t   ! temporary scalars
+      INTEGER  ::   ji, jj, jn                                     ! dummy loop indices
+      REAL(wp) ::   zsrau, zse3t                                   ! temporary scalars
+      REAL(wp) ::   zswitch, zftra, zcd, zdtra, ztfx, ztra, zeuler ! temporary scalars
       CHARACTER (len=22) :: charout
       REAL(wp), POINTER, DIMENSION(:,:  ) :: zsfx
       REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd
+
       !!---------------------------------------------------------------------
       !
@@ -72,4 +76,10 @@
                       CALL wrk_alloc( jpi, jpj,      zsfx   )
       IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )
+
+      SELECT CASE( nn_ice_embd )         ! levitating or embedded sea-ice option
+         CASE( 0    )   ;   zswitch = 1  ! (0) standard levitating sea-ice : salt exchange only
+         CASE( 1, 2 )   ;   zswitch = 0  ! (1) levitating sea-ice: salt and volume exchange but no pressure effect                                
+                                         ! (2) embedded sea-ice : salt and volume fluxes and pressure
+      END SELECT
 
       IF( kt == nittrc000 ) THEN
@@ -91,14 +101,65 @@
       ! 0. initialization
       zsrau = 1. / rau0
+
+      zeuler = 1.   ;  IF ( neuler .EQ. 0 ) zeuler = 0.
+
       DO jn = 1, jptra
          !
          IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
          !                                             ! add the trend to the general tracer trend
-         DO jj = 2, jpj
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-               zse3t = 1. / fse3t(ji,jj,1)
-               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t
+
+         IF ( nn_ice_tr == -1 ) THEN  ! identical concentrations in ice and ocean (old code)
+
+            DO jj = 2, jpj
+               DO ji = fs_2, fs_jpim1   ! vector opt.
+                  zse3t = 1. / fse3t(ji,jj,1)
+                  tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t
+               END DO
             END DO
-         END DO
+
+         ELSE
+
+            DO jj = 2, jpj
+               DO ji = fs_2, fs_jpim1   ! vector opt.
+   
+                  zse3t = 1. / fse3t(ji,jj,1)
+                  
+                  ! tracer flux at the ice/ocean interface (tracer/m2/s)
+                  zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice
+                  zcd   =   trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting,
+                                                               ! only used in the levitating sea ice case
+                  ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux
+                  ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux
+                  ztfx  = zftra + zswitch * zcd                ! net tracer flux (+C/D if no ice/ocean mass exchange)
+   
+                  ! tracer change (left member: euler; right member:leapfrog)
+                  ztra = ( 1. - zeuler ) * trn(ji,jj,1,jn) + zeuler * trb(ji,jj,1,jn)
+                  
+                  ! MAX is there to avoid integral ocean uptake in the case of freezing (for iron)
+                  zdtra = MAX ( - ztra / r2dtra(1) , zsrau * ( ztfx + zsfx(ji,jj) * trn(ji,jj,1,jn) ) * zse3t ) ! tracer tendency
+                  ! r2dtra is time step
+                  tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zdtra ! new line
+   
+   !              IF ( ztfx .NE. 0.0 ) THEN
+   !                  WRITE(numout,*) ji, jj, jn
+   !                  WRITE(numout,*) ' trc_o  : ', trc_o(ji,jj,jn)
+   !                  WRITE(numout,*) ' trc_i  : ', trc_i(ji,jj,jn)
+   !                  WRITE(numout,*) ' fmmflx : ', fmmflx(ji,jj)
+   !                  WRITE(numout,*) ' zswitch: ', zswitch
+   !                  WRITE(numout,*) ' zcd   : ', zcd
+   !                  WRITE(numout,*) ' zftra : ', zftra
+   !                  WRITE(numout,*) ' ztfx  : ', ztfx
+   !                  WRITE(numout,*) ' zsrau : ', zsrau
+   !                  WRITE(numout,*) ' zsfx  : ', zsfx(ji,jj)
+   !                  WRITE(numout,*) ' zse3t : ', zse3t
+   !                  WRITE(numout,*) ' ztra  : ', ztra
+   !                  WRITE(numout,*) ' zdtra : ', zdtra
+   !                  WRITE(numout,*) ' Old tendency : ', zsfx(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t
+   !              ENDIF
+   
+               END DO
+            END DO
+   
+         ENDIF
          
          IF( l_trdtrc ) THEN
Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 5184)
@@ -34,7 +34,10 @@
    REAL(wp), PUBLIC                                                ::  areatot        !: total volume 
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  cvol           !: volume correction -degrad option- 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trn            !: traceur concentration for now time step
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  tra            !: traceur concentration for next time step
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trb            !: traceur concentration for before time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trn            !: tracer concentration for now time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  tra            !: tracer concentration for next time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trb            !: tracer concentration for before time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_i          !: prescribed tracer concentration in sea ice for SBC
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_o          !: prescribed tracer concentration in ocean for SBC
+   INTEGER             , PUBLIC                                    ::  nn_ice_tr      !: handling of sea ice tracers
 
    !! interpolated gradient
@@ -185,4 +188,5 @@
       !
       ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra),       &  
+         &      trc_i(jpi,jpj,jptra)  , trc_o(jpi,jpj,jptra)                          ,       &
          &      gtru (jpi,jpj,jptra)  , gtrv (jpi,jpj,jptra)                          ,       &
          &      gtrui(jpi,jpj,jptra)  , gtrvi(jpi,jpj,jptra)                          ,       &
Index: branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 5175)
+++ branches/2015/dev_r5171_CNRS_LIM3_seaicebgc/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 5184)
@@ -31,4 +31,5 @@
    USE lib_mpp         ! distribued memory computing library
    USE sbc_oce
+   USE trcice          ! tracers in sea ice
  
    IMPLICIT NONE
@@ -100,4 +101,6 @@
       IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer
       IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC  tracers
+
+      CALL trc_ice_ini                                 ! Tracers in sea ice
 
       IF( lwp ) THEN
