Index: NEMO/trunk/tests/BENCH/MY_SRC/usrdef_istate.F90
===================================================================
--- NEMO/trunk/tests/BENCH/MY_SRC/usrdef_istate.F90	(revision 14261)
+++ NEMO/trunk/tests/BENCH/MY_SRC/usrdef_istate.F90	(revision 14273)
@@ -72,10 +72,10 @@
          zfact = REAL(jk-1,wp) / REAL(jpk-1,wp)   ! 0 to 1 to add a basic stratification
          ! temperature choosen to lead to ~50% ice at the beginning if rn_thres_sst = 0.5
-         pts(:,:,jk,jp_tem) = 20._wp*z2d(:,:) - 1._wp - 0.5_wp * zfact    ! -1 to -1.5 +/- 1.0 degG
+         pts(ji,jj,jk,jp_tem) = 20._wp*z2d(ji,jj) - 1._wp - 0.5_wp * zfact    ! -1 to -1.5 +/- 1.0 degG
          ! salinity:  
-         pts(:,:,jk,jp_sal) = 30._wp + 1._wp * zfact + z2d(:,:)           ! 30 to 31   +/- 0.05 psu
+         pts(ji,jj,jk,jp_sal) = 30._wp + 1._wp * zfact + z2d(ji,jj)           ! 30 to 31   +/- 0.05 psu
          ! velocities:
-         pu(:,:,jk) = z2d(:,:) *  0.1_wp * umask(:,:,jk)                  ! +/- 0.005  m/s
-         pv(:,:,jk) = z2d(:,:) * 0.01_wp * vmask(:,:,jk)                  ! +/- 0.0005 m/s
+         pu(ji,jj,jk) = z2d(ji,jj) *  0.1_wp * umask(ji,jj,jk)                ! +/- 0.005  m/s
+         pv(ji,jj,jk) = z2d(ji,jj) * 0.01_wp * vmask(ji,jj,jk)                ! +/- 0.0005 m/s
       END_3D
       pts(:,:,jpk,:) = 0._wp
Index: NEMO/trunk/tests/BENCH/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/BENCH/MY_SRC/usrdef_sbc.F90	(revision 14261)
+++ NEMO/trunk/tests/BENCH/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -30,7 +30,7 @@
    PRIVATE
 
-   PUBLIC   usrdef_sbc_oce      ! routine called in sbcmod module
-   PUBLIC   usrdef_sbc_ice_tau  ! routine called by sbcice_lim.F90 for ice dynamics
-   PUBLIC   usrdef_sbc_ice_flx  ! routine called by sbcice_lim.F90 for ice thermo
+   PUBLIC   usrdef_sbc_oce      ! routine called by sbcmod.F90 for sbc ocean
+   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
+   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
 
    !! * Substitutions
@@ -83,5 +83,4 @@
          !
       ENDIF
-      
       !
    END SUBROUTINE usrdef_sbc_oce
@@ -97,5 +96,5 @@
       INTEGER, INTENT(in) ::   kt   ! ocean time step
       !
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D workspace
+      REAL(wp) ::   zztmp
       INTEGER  ::   ji, jj
       !!---------------------------------------------------------------------
@@ -106,8 +105,8 @@
       !
       DO_2D( 0, 0, 0, 0 )
-         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
+         zztmp = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
+         utau_ice(ji,jj) = 0.1_wp + zztmp
+         vtau_ice(ji,jj) = 0.1_wp + zztmp
       END_2D
-      utau_ice(:,:) = 0.1_wp + z2d(:,:)
-      vtau_ice(:,:) = 0.1_wp + z2d(:,:)
 
       CALL lbc_lnk_multi( 'usrdef_sbc', utau_ice, 'U', -1., vtau_ice, 'V', -1. )
@@ -121,6 +120,5 @@
       !!                     ***  ROUTINE usrdef_sbc_ice_flx  ***
       !!
-      !! ** Purpose :   provide the surface boundary (flux) condition over
-      !sea-ice
+      !! ** Purpose :   provide the surface boundary (flux) condition over sea-ice
       !!---------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt   ! ocean time step
@@ -130,6 +128,6 @@
       REAL(wp), DIMENSION(jpi,jpj) ::   zsnw   ! snw distribution after wind blowing
       !!---------------------------------------------------------------------
+#if defined key_si3
       !
-#if defined key_si3
       IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : BENCH case: NO flux forcing'
       !
@@ -137,10 +135,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
@@ -148,6 +147,5 @@
       ! ice fields deduced from above
       zsnw(:,:) = 1._wp
-      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after
-      !wind blowing 
+      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after wind blowing 
       emp_ice  (:,:)   = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw(:,:)
       emp_oce  (:,:)   = emp_oce(:,:) - sprecip(:,:) * (1._wp - zsnw(:,:) )
@@ -164,5 +162,4 @@
       ! --- shortwave radiation transmitted thru the surface scattering layer (W/m2) --- !
       qtr_ice_top(:,:,:) = 0._wp
-
 #endif
 
Index: NEMO/trunk/tests/DONUT/EXPREF/file_def_nemo-ice.xml
===================================================================
--- NEMO/trunk/tests/DONUT/EXPREF/file_def_nemo-ice.xml	(revision 14261)
+++ NEMO/trunk/tests/DONUT/EXPREF/file_def_nemo-ice.xml	(revision 14273)
@@ -53,7 +53,6 @@
        <field field_ref="normstr"          name="normstr" />
        <field field_ref="sheastr"          name="sheastr" />
-       <field field_ref="isig1"            name="isig1"   />
-       <field field_ref="isig2"            name="isig2"   />
-       <field field_ref="isig3"            name="isig3"   />
+       <field field_ref="sig1_pnorm"       name="sig1_pnorm"/>
+       <field field_ref="sig2_pnorm"       name="sig2_pnorm"/>
        
        <!-- heat fluxes -->
@@ -68,21 +67,5 @@
        <field field_ref="albedo"           name="albedo"     />
        
-	  <!-- heat fluxes -->
-          <field id="hfxbog"       long_name="heat flux used for bottom ice growth (neg.)"                  unit="W/m2" />
-          <field id="hfxbom"       long_name="heat flux used for bottom ice melt (pos.)"                    unit="W/m2" />
-          <field id="hfxsum"       long_name="heat flux used for surface ice melt"                          unit="W/m2" />
-          <field id="hfxopw"       long_name="heat flux used for open water ice formation"                  unit="W/m2" />
-          <field id="hfxdif"       long_name="heat flux used for ice temperature change"                    unit="W/m2" />
-          <field id="hfxsnw"       long_name="heat flux used for snow melt"                                 unit="W/m2" />
-          <field id="hfxerr"       long_name="heat flux error after heat diffusion"                         unit="W/m2" />
-          <!-- heat fluxes associated with mass exchange -->
-          <field id="hfxthd"       long_name="heat fluxes from ice-ocean mass exchange during thermo"       unit="W/m2" />
-          <field id="hfxdyn"       long_name="heat fluxes from ice-ocean mass exchange during dynamic"      unit="W/m2" />
-          <field id="hfxres"       long_name="heat fluxes from undiagnosed processes"                       unit="W/m2" />
-          <field id="hfxsub"       long_name="heat fluxes from ice-atm. mass exchange during sublimation"   unit="W/m2" />
-          <field id="hfxspr"       long_name="heat fluxes from ice-atm. mass exchange during snow precip"   unit="W/m2" />
-          <field id="hfxdhc"       long_name="Heat content variation in snow and ice (neg = ice cooling)"   unit="W/m2" />
-
-	  <field field_ref="hfxcndtop"        name="hfxcndtop"  />
+       <field field_ref="hfxcndtop"        name="hfxcndtop"  />
        <field field_ref="hfxcndbot"        name="hfxcndbot"  />
        <field field_ref="hfxsensib"        name="hfxsensib"  />
@@ -94,5 +77,5 @@
        <field field_ref="vfxice"           name="vfxice" />
        <field field_ref="vfxsnw"           name="vfxsnw" />
-       
+
        <!-- categories -->
        <field field_ref="icemask_cat"      name="simskcat"/>
Index: NEMO/trunk/tests/DONUT/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/DONUT/MY_SRC/usrdef_sbc.F90	(revision 14273)
+++ NEMO/trunk/tests/DONUT/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -0,0 +1,152 @@
+MODULE usrdef_sbc
+   !!======================================================================
+   !!                       ***  MODULE  usrdef_sbc  ***
+   !! 
+   !!                      ===  DONUT configuration  ===
+   !!
+   !! User defined :   surface forcing of a user configuration
+   !!======================================================================
+   !! History :  4.0   ! 2016-03  (S. Flavoni, G. Madec)  user defined interface
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   usr_def_sbc    : user defined surface bounday conditions in DONUT case
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbc_ice         ! Surface boundary condition: ice fields
+   USE in_out_manager  ! I/O manager
+   USE phycst          ! physical constants
+#if defined key_si3
+   USE ice, ONLY       : at_i_b, a_i_b
+#endif
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   usrdef_sbc_oce      ! routine called by sbcmod.F90 for sbc ocean
+   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
+   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+   !! $Id: usrdef_sbc.F90 10074 2018-08-28 16:15:49Z nicolasmartin $
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE usrdef_sbc_oce( kt, Kbb )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE usr_def_sbc  ***
+      !!              
+      !! ** Purpose :   provide at each time-step the surface boundary
+      !!              condition, i.e. the momentum, heat and freshwater fluxes.
+      !!
+      !! ** Method  :   all 0 fields, for DONUT case
+      !!                CAUTION : never mask the surface stress field !
+      !!
+      !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e.   
+      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      INTEGER, INTENT(in) ::   Kbb  ! ocean time index
+      !!---------------------------------------------------------------------
+      !
+      IF( kt == nit000 ) THEN
+         !
+         IF(lwp)   WRITE(numout,*)' usrdef_sbc_oce : DONUT case: NO surface forcing'
+         ! --- oce variables --- !
+         utau(:,:) = 0._wp 
+         vtau(:,:) = 0._wp
+         taum(:,:) = 0._wp
+         wndm(:,:) = 0._wp
+         !
+         emp (:,:) = 0._wp
+         sfx (:,:) = 0._wp
+         qns (:,:) = 0._wp
+         qsr (:,:) = 0._wp
+         !
+         utau_b(:,:) = 0._wp 
+         vtau_b(:,:) = 0._wp
+         emp_b (:,:) = 0._wp
+         sfx_b (:,:) = 0._wp
+         qns_b (:,:) = 0._wp
+         !
+      ENDIF
+      !
+   END SUBROUTINE usrdef_sbc_oce
+
+
+   SUBROUTINE usrdef_sbc_ice_tau( kt )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE usrdef_sbc_ice_tau  ***
+      !!
+      !! ** Purpose :   provide the surface boundary (momentum) condition over sea-ice
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !!---------------------------------------------------------------------
+#if defined key_si3
+      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : DONUT case: NO stress forcing'
+      !
+      utau_ice(:,:) = 0._wp
+      vtau_ice(:,:) = 0._wp
+#endif
+      !
+   END SUBROUTINE usrdef_sbc_ice_tau
+
+
+   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE usrdef_sbc_ice_flx  ***
+      !!
+      !! ** Purpose :   provide the surface boundary (flux) condition over sea-ice
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   phs    ! snow thickness
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   phi    ! ice thickness
+      !!
+      REAL(wp), DIMENSION(jpi,jpj) ::   zsnw   ! snw distribution after wind blowing
+      !!---------------------------------------------------------------------
+#if defined key_si3
+      !
+      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : DONUT case: NO flux forcing'
+      !
+      ! ocean variables (renaming)
+      emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
+      qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
+
+      ! ice variables
+      alb_ice (:,:,:) = 0.7_wp  ! useless
+      qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
+      sprecip (:,:)   = 0._wp   ! uniform value for snow precip
+      evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
+
+      ! ice fields deduced from above
+      zsnw(:,:) = 1._wp
+      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after wind blowing 
+      emp_ice  (:,:)   = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw(:,:)
+      emp_oce  (:,:)   = emp_oce(:,:) - sprecip(:,:) * (1._wp - zsnw(:,:) )
+      qevap_ice(:,:,:) =   0._wp
+      qprec_ice(:,:)   =   rhos * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) !  in J/m3
+      qemp_oce (:,:)   = - emp_oce(:,:) * sst_m(:,:) * rcp
+      qemp_ice (:,:)   =   sprecip(:,:) * zsnw * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) ! solid precip (only)
+
+      ! total fluxes
+      emp_tot (:,:) = emp_ice  + emp_oce
+      qns_tot (:,:) = at_i_b(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
+      qsr_tot (:,:) = at_i_b(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
+
+      ! --- shortwave radiation transmitted thru the surface scattering layer (W/m2) --- !
+      qtr_ice_top(:,:,:) = 0._wp
+#endif
+
+   END SUBROUTINE usrdef_sbc_ice_flx
+
+
+   !!======================================================================
+END MODULE usrdef_sbc
Index: NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90	(revision 14261)
+++ NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -120,10 +120,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
Index: NEMO/trunk/tests/ICE_ADV2D/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/ICE_ADV2D/MY_SRC/usrdef_sbc.F90	(revision 14261)
+++ NEMO/trunk/tests/ICE_ADV2D/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -118,10 +118,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
Index: NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14261)
+++ NEMO/trunk/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -119,10 +119,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
Index: NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90
===================================================================
--- NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90	(revision 14261)
+++ NEMO/trunk/tests/ICE_RHEO/MY_SRC/usrdef_sbc.F90	(revision 14273)
@@ -179,10 +179,11 @@
       emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
       qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
-      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
+      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
 
       ! ice variables
       alb_ice (:,:,:) = 0.7_wp  ! useless
       qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
-      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
+      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
+      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
       sprecip (:,:)   = 0._wp   ! uniform value for snow precip
       evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
