Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 7280)
@@ -47,11 +47,10 @@
                            !     (also = the frequency of sea-ice model call)
    ln_flx      = .true.    !  flux formulation                          (T => fill namsbc_flx )
-   ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core)
-   nn_ice      = 0         !  =0 no ice boundary condition   ,
+   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
+   nn_ice      = 0         !  =0 no ice boundary condition
    ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
    nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
-   ln_apr_dyn  = .false.    !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
+   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
    ln_traqsr   = .false.   !  Light penetration (T) or not (F)
-
 /
 !-----------------------------------------------------------------------
@@ -60,26 +59,10 @@
 !          !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
 !          !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
-   sn_utau     = 'amm12_utau'     ,          1        ,  'utau'      , .false.      , .false. , 'daily'   ,  ''      ,  ''  , ''
-   sn_vtau     = 'amm12_vtau'     ,          1        ,  'vtau'      , .false.      , .false. , 'daily'   ,  ''      ,  ''  , ''
-   sn_qtot     = 'amm12_flx'      ,          3        ,  'sonsfldo'  ,  .true.      , .false. , 'daily'   ,  ''      ,  ''  , ''
-   sn_qsr      = 'amm12_flx'      ,          3        ,  'soshfldo'  ,  .true.      , .false. , 'daily'   ,  ''      ,  ''  , ''
-   sn_emp      = 'amm12_flx'      ,          3        ,  'sowafldo'  ,  .true.      , .false. , 'daily'   ,  ''      ,  ''  , ''
-   cn_dir      = './fluxes/'        !  root directory for the location of the flux files
-/
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
+   sn_utau = 'amm12_utau',          1        , 'utau'    ,  .false.     , .false., 'daily'   ,  ''      ,  ''      , ''
+   sn_vtau = 'amm12_vtau',          1        , 'vtau'    ,  .false.     , .false., 'daily'   ,  ''      ,  ''      , ''
+   sn_qtot = 'amm12_flx' ,          3        , 'sonsfldo',  .true.      , .false., 'daily'   ,  ''      ,  ''      , ''
+   sn_qsr  = 'amm12_flx' ,          3        , 'soshfldo',  .true.      , .false., 'daily'   ,  ''      ,  ''      , ''
+   sn_emp  = 'amm12_flx' ,          3        , 'sowafldo',  .true.      , .false., 'daily'   ,  ''      ,  ''      , ''
+   cn_dir  = './fluxes/'        !  root directory for the location of the flux files
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 7280)
@@ -96,9 +96,5 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
+&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
 !-----------------------------------------------------------------------
 !              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
@@ -112,9 +108,13 @@
    sn_prec     = 'forcing_PAPASTATION_1h' ,         1         , 'prec'    ,   .false.    , .false. , 'yearly' , '' , '', ''
    sn_snow     = 'forcing_PAPASTATION_1h' ,         1         , 'snow'    ,   .false.    , .false. , 'yearly' , '' , '', ''
-   rn_zqt      =  2.    !  air temperature and humidity referenced at 2m (T) instead 10m (F)
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
+   sn_slp      = 'slp.15JUNE2009_fill'        ,         6         , 'SLP',        .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''
+
+   nn_bulk_algo = 1        !  Bulk algorithm to use to compute bulk transfer coefficients Cd, Ce and Ch
+                           !  1 => "NCAR" algorithm        (Large and Yeager, 2008)
+                           !  2 => "COARE 3.0" algorithm   (Fairall et al 2003)
+                           !  3 => "ECMWF" algorithm       (IFS cycle 31)
+                           !  4 => "COARE 3.5" algorithm   (Edson et al 2013)
+
+   rn_zqt      =  2.       !  Air temperature and humidity reference height (m)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg	(revision 7280)
@@ -57,4 +57,5 @@
    !                       !     (also = the frequency of sea-ice model call)
    ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc)
+   ln_blk      = .false.   !  CORE bulk formulation                     (T => fill namsbc_core)
    nn_ice      = 0         !  =0 no ice boundary condition   ,
    ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
@@ -67,24 +68,4 @@
    nn_tau000   =   100     !  gently increase the stress over the first ntau_rst time-steps
    rn_utau0    =   0.1e0   !  uniform value for the i-stress
-/
-!-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 7280)
@@ -55,28 +55,9 @@
                            !     (also = the frequency of sea-ice model call)
    ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc)
+   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
    nn_ice      = 0         !  =0 no ice boundary condition   ,
    ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
    ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
    nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
-/
-!-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 7280)
@@ -46,4 +46,5 @@
                            !     (also = the frequency of sea-ice model call)
    ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc)
+   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
    nn_ice      = 0         !  =0 no ice boundary condition   ,
    ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
@@ -57,9 +58,4 @@
    ln_qsr_2bd  = .true.    !  2 bands              light penetration
    nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
-/
-
-!-----------------------------------------------------------------------
-&namberg       !   iceberg parameters
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg	(revision 7280)
@@ -46,4 +46,5 @@
                            !     (also = the frequency of sea-ice model call)
    ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc)
+   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
    nn_ice      = 0         !  =0 no ice boundary condition   ,
    ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
@@ -55,25 +56,5 @@
 !-----------------------------------------------------------------------
    nn_tau000   =   100     !  gently increase the stress over the first ntau_rst time-steps
-   rn_utau0    =   0.1e0   !  uniform value for the i-stress
-/
-!-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
+   rn_utau0    =   0.1     !  uniform value for the i-stress
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg	(revision 7280)
@@ -56,26 +56,21 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-!              !  file name                    ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                               ! rotation ! land/sea mask !
-!              !                               !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                              ! pairing  ! filename      !
-   sn_wndi     = 'u_10.15JUNE2009_fill'        ,         6         , 'U_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'      , 'Uwnd'   , ''
-   sn_wndj     = 'v_10.15JUNE2009_fill'        ,         6         , 'V_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'      , 'Vwnd'   , ''
-   sn_qsr      = 'ncar_rad.15JUNE2009_fill'    ,        24         , 'SWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_qlw      = 'ncar_rad.15JUNE2009_fill'    ,        24         , 'LWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_tair     = 't_10.15JUNE2009_fill'        ,         6         , 'T_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_humi     = 'q_10.15JUNE2009_fill'        ,         6         , 'Q_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_prec     = 'ncar_precip.15JUNE2009_fill' ,        -1         , 'PRC_MOD1',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_snow     = 'ncar_precip.15JUNE2009_fill' ,        -1         , 'SNOW'    ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_tdif     = 'taudif_core'                 ,        24         , 'taudif'  ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-
-   cn_dir      = './'      !  root directory for the location of the bulk files
-   ln_taudif   = .false.   !  HF tau contribution: use "mean of stress module - module of the mean stress" data
-   rn_zqt      = 10.        !  Air temperature and humidity reference height (m)
-   rn_zu       = 10.        !  Wind vector reference height (m)
-   rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow)
-   rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.)
-   rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity
-                           !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds)
+&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
+!-----------------------------------------------------------------------
+!              !  file name                   ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                              ! rotation ! land/sea mask !
+!              !                              !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                             ! pairing  ! filename      !
+   sn_wndi     = 'u_10.15JUNE2009_fill'       ,         6         , 'U_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'     , 'Uwnd'   , ''
+   sn_wndj     = 'v_10.15JUNE2009_fill'       ,         6         , 'V_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'     , 'Vwnd'   , ''
+   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,        24         , 'SWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,        24         , 'LWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_tair     = 't_10.15JUNE2009_fill'       ,         6         , 'T_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_humi     = 'q_10.15JUNE2009_fill'       ,         6         , 'Q_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_prec     = 'ncar_precip.15JUNE2009_fill',        -1         , 'PRC_MOD1',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_snow     = 'ncar_precip.15JUNE2009_fill',        -1         , 'SNOW'    ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_slp      = 'slp.15JUNE2009_fill'        ,         6         , 'SLP'     ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_tdif     = 'taudif_core'                ,        24         , 'taudif'  ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   !
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
+   !
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg	(revision 7280)
@@ -43,9 +43,10 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg	(revision 7280)
@@ -35,5 +35,5 @@
 !-----------------------------------------------------------------------
 &namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+!              !   passive tracer coarsened online simulations
 !-----------------------------------------------------------------------
 /
@@ -57,26 +57,22 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-!              !  file name                    ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                               ! rotation ! land/sea mask !
-!              !                               !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                              ! pairing  ! filename      !
-   sn_wndi     = 'u_10.15JUNE2009_fill'        ,         6         , 'U_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'      , 'Uwnd'   , ''
-   sn_wndj     = 'v_10.15JUNE2009_fill'        ,         6         , 'V_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'      , 'Vwnd'   , ''
-   sn_qsr      = 'ncar_rad.15JUNE2009_fill'    ,        24         , 'SWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_qlw      = 'ncar_rad.15JUNE2009_fill'    ,        24         , 'LWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_tair     = 't_10.15JUNE2009_fill'        ,         6         , 'T_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_humi     = 'q_10.15JUNE2009_fill'        ,         6         , 'Q_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_prec     = 'ncar_precip.15JUNE2009_fill' ,        -1         , 'PRC_MOD1',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_snow     = 'ncar_precip.15JUNE2009_fill' ,        -1         , 'SNOW'    ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-   sn_tdif     = 'taudif_core'                 ,        24         , 'taudif'  ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'     , ''       , ''
-
-   cn_dir      = './'      !  root directory for the location of the bulk files
-   ln_taudif   = .false.   !  HF tau contribution: use "mean of stress module - module of the mean stress" data
-   rn_zqt      = 10.        !  Air temperature and humidity reference height (m)
-   rn_zu       = 10.        !  Wind vector reference height (m)
-   rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow)
-   rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.)
-   rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity
-                           !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds)
+&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
+!-----------------------------------------------------------------------
+!              !  file name                   ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                              ! rotation ! land/sea mask !
+!              !                              !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                             ! pairing  ! filename      !
+   sn_wndi     = 'u_10.15JUNE2009_fill'       ,         6         , 'U_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'     , 'Uwnd'   , ''
+   sn_wndj     = 'v_10.15JUNE2009_fill'       ,         6         , 'V_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bicubic.nc'     , 'Vwnd'   , ''
+   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,        24         , 'SWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,        24         , 'LWDN_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_tair     = 't_10.15JUNE2009_fill'       ,         6         , 'T_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_humi     = 'q_10.15JUNE2009_fill'       ,         6         , 'Q_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_prec     = 'ncar_precip.15JUNE2009_fill',        -1         , 'PRC_MOD1',   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_snow     = 'ncar_precip.15JUNE2009_fill',        -1         , 'SNOW'    ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_slp      = 'slp.15JUNE2009_fill'        ,         6         , 'SLP'     ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   sn_tdif     = 'taudif_core'                ,        24         , 'taudif'  ,   .false.    , .true. , 'yearly'  , 'weights_core2_agrif_bilinear.nc'    , ''       , ''
+   !
+   !                    !  bulk algorithm :
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
+   !
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg	(revision 7280)
@@ -43,9 +43,10 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  Bulk formulae
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg	(revision 7280)
@@ -116,5 +116,5 @@
    nn_fsbc     = 5         !  frequency of surface boundary condition computation 
                            !     (also = the frequency of sea-ice model call)
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
+   ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx )
    nn_ice      = 0         !  =0 no ice boundary condition   ,
                            !  =1 use observed ice-cover      ,
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg	(revision 7280)
@@ -70,25 +70,10 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
-/
-!-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
-!-----------------------------------------------------------------------
-/      
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3")
-!-----------------------------------------------------------------------
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  Bulk formulae
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg	(revision 7280)
@@ -43,9 +43,10 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  Bulk formulae
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 7280)
@@ -48,9 +48,15 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
    nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
    ln_rnf      = .false.   !  runoffs
    ln_traqsr   = .false.   !  Light penetration (T) or not (F)
-/  
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  Bulk formulae
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
+/
 !-----------------------------------------------------------------------
 &namtra_qsr    !   penetrative solar radiation
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg	(revision 7280)
@@ -43,14 +43,15 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namtra_qsr    !   penetrative solar radiation
-!-----------------------------------------------------------------------
-/
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
+/
+!-----------------------------------------------------------------------
+&namsbc_blk   !   namsbc_blk  Bulk formulae
+!-----------------------------------------------------------------------
+   ln_NCAR     = .true.   ! "NCAR"      algorithm   (Large and Yeager 2008)
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   Stand-Alone Surface module
+!-----------------------------------------------------------------------
+/      
 !-----------------------------------------------------------------------
 &namsbc_rnf    !   runoffs namelist surface boundary condition
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7280)
@@ -4,5 +4,5 @@
 !! NEMO/OPA  :  1 - run manager      (namrun)
 !! namelists    2 - Domain           (namcfg, namzgr, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
-!!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas
+!!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_sas)
 !!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,
 !!                                    namsbc_apr, namsbc_ssr, namsbc_alb, namsbc_wave)
@@ -162,9 +162,7 @@
 !!   namsbc          surface boundary condition
 !!   namsbc_flx      flux               formulation                     (ln_flx     =T)
-!!   namsbc_clio     CLIO bulk formulae formulation                     (ln_blk_clio=T)
-!!   namsbc_core     CORE bulk formulae formulation                     (ln_blk_core=T)
-!!   namsbc_mfs      MFS  bulk formulae formulation                     (ln_blk_mfs =T)
+!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
 !!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
-!!   namsbc_sas      StAndalone Surface module
+!!   namsbc_sas      Stand-Alone Surface module
 !!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
 !!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
@@ -186,7 +184,5 @@
    ln_usr      = .false.   !  user defined formulation                  (T => check usrdef_sbc)
    ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx )
-   ln_blk_clio = .false.   !  CLIO bulk formulation                     (T => fill namsbc_clio)
-   ln_blk_core = .false.    !  CORE bulk formulation                     (T => fill namsbc_core)
-   ln_blk_mfs  = .false.   !  MFS bulk formulation                      (T => fill namsbc_mfs )
+   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                      ! Type of coupling (Ocean/Ice/Atmosphere) :
    ln_cpl      = .false.   !  atmosphere coupled   formulation          ( requires key_oasis3 )
@@ -204,10 +200,10 @@
    nn_ice      = 2         !  =0 no ice boundary condition   ,
                            !  =1 use observed ice-cover      ,
-                           !  =2 ice-model used                         ("key_lim3", "key_lim2", "key_cice")
+                           !  =2 to 4 :  ice-model used (LIM2, LIM3 or CICE)                         ("key_lim3", "key_lim2", or "key_cice")
    nn_ice_embd = 1         !  =0 levitating ice (no mass exchange, concentration/dilution effect)
                            !  =1 levitating ice with mass and salt exchange but no presure effect
                            !  =2 embedded sea-ice (full salt and mass exchanges and pressure)
                      ! Misc. options of sbc : 
-   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr )
+   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr)
    ln_dm2dc    = .false.   !  daily mean to diurnal cycle on short wave
    ln_rnf      = .true.    !  runoffs                                   (T => fill namsbc_rnf)
@@ -216,6 +212,6 @@
                            !     =1 global mean of e-p-r set to zero at each time step
                            !     =2 annual global mean of e-p-r set to zero
-   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
-   ln_isf      = .false.   !  ice shelf                                 (T   => fill namsbc_isf)
+   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr)
+   ln_isf      = .false.   !  ice shelf                                 (T => fill namsbc_isf)
    ln_wave     = .false.   !  coupling with surface wave                (T => fill namsbc_wave)
    nn_lsm      = 0         !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
@@ -223,5 +219,5 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
+&namsbc_flx    !   surface boundary condition : flux formulation        (ln_ana = T)
 !-----------------------------------------------------------------------
 !              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
@@ -236,23 +232,8 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
-!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
-   sn_utau     = 'taux_1m'   ,       -1          , 'sozotaux',   .true.     , .true. , 'yearly'  , ''       , ''       , ''
-   sn_vtau     = 'tauy_1m'   ,       -1          , 'sometauy',   .true.     , .true. , 'yearly'  , ''       , ''       , ''
-   sn_wndm     = 'flx'       ,       -1          , 'socliowi',   .true.     , .true. , 'yearly'  , ''       , ''       , ''
-   sn_tair     = 'flx'       ,       -1          , 'socliot2',   .true.     , .true. , 'yearly'  , ''       , ''       , ''
-   sn_humi     = 'flx'       ,       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''       , ''
-   sn_ccov     = 'flx'       ,       -1          , 'socliocl',   .false.    , .true. , 'yearly'  , ''       , ''       , ''
-   sn_prec     = 'flx'       ,       -1          , 'socliopl',   .false.    , .true. , 'yearly'  , ''       , ''       , ''
-
-   cn_dir      = './'      !  root directory for the location of the bulk files are
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-!              !  file name                   ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                               ! rotation ! land/sea mask !
-!              !                              !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                              ! pairing  ! filename      !
+&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
+!-----------------------------------------------------------------------
+!              !  file name                   ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                              ! rotation ! land/sea mask !
+!              !                              !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                             ! pairing  ! filename      !
    sn_wndi     = 'u_10.15JUNE2009_fill'       ,         6         , 'U_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'   , 'Uwnd'   , ''
    sn_wndj     = 'v_10.15JUNE2009_fill'       ,         6         , 'V_10_MOD',   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'   , 'Vwnd'   , ''
@@ -263,6 +244,12 @@
    sn_prec     = 'ncar_precip.15JUNE2009_fill',        -1         , 'PRC_MOD1',   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''
    sn_snow     = 'ncar_precip.15JUNE2009_fill',        -1         , 'SNOW'    ,   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''
+   sn_slp      = 'slp.15JUNE2009_fill'        ,         6         , 'SLP'     ,   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''
    sn_tdif     = 'taudif_core'                ,        24         , 'taudif'  ,   .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''
-
+   !                    !  bulk algorithm :
+   ln_NCAR     = .false.   ! "NCAR"      algorithm   (Large and Yeager 2008)
+   ln_COARE_3p0= .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   ln_COARE_3p5= .false.   ! "COARE 3.5" algorithm   (Edson et al. 2013)
+   ln_ECMWF    = .false.   ! "ECMWF"     algorithm   (IFS cycle 31)
+   !
    cn_dir      = './'      !  root directory for the location of the bulk files
    ln_taudif   = .false.   !  HF tau contribution: use "mean of stress module - module of the mean stress" data
@@ -273,19 +260,4 @@
    rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity
                            !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds)
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
-!              !  file name  ! frequency (hours) ! variable ! time interp. !  clim  ! 'yearly'/ ! weights     ! rotation ! land/sea mask !
-!              !             !  (if <0  months)  !   name   !   (logical)  !  (T/F) ! 'monthly' ! filename    ! pairing  ! filename      !
-   sn_wndi     =   'ecmwf'   ,        6          , 'u10'    ,    .true.    , .false., 'daily'   ,'bicubic.nc' ,   ''     ,   ''
-   sn_wndj     =   'ecmwf'   ,        6          , 'v10'    ,    .true.    , .false., 'daily'   ,'bicubic.nc' ,   ''     ,   ''
-   sn_clc      =   'ecmwf'   ,        6          , 'clc'    ,    .true.    , .false., 'daily'   ,'bilinear.nc',   ''     ,   ''
-   sn_msl      =   'ecmwf'   ,        6          , 'msl'    ,    .true.    , .false., 'daily'   ,'bicubic.nc' ,   ''     ,   ''
-   sn_tair     =   'ecmwf'   ,        6          , 't2'     ,    .true.    , .false., 'daily'   ,'bicubic.nc' ,   ''     ,   ''
-   sn_rhm      =   'ecmwf'   ,        6          , 'rh'     ,    .true.    , .false., 'daily'   ,'bilinear.nc',   ''     ,   ''
-   sn_prec     =   'ecmwf'   ,        6          , 'precip' ,    .true.    , .true. , 'daily'   ,'bicubic.nc' ,   ''     ,   ''
-
-   cn_dir      = './ECMWF/'      !  root directory for the location of the bulk files
 /
 !-----------------------------------------------------------------------
@@ -415,5 +387,5 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing           (ln_apr_dyn =T)
 !-----------------------------------------------------------------------
 !              !  file name ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/cfg.txt	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/CONFIG/cfg.txt	(revision 7280)
@@ -6,5 +6,4 @@
 GYRE_BFM OPA_SRC TOP_SRC
 AMM12 OPA_SRC
-ORCA2_LIM3 OPA_SRC LIM_SRC_3 NST_SRC
 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC
 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
@@ -14,2 +13,3 @@
 GYRE OPA_SRC
 ISOMIP OPA_SRC
+ORCA2_LIM3 OPA_SRC LIM_SRC_3 NST_SRC
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 7280)
@@ -5,5 +5,5 @@
    !!======================================================================
    !! History :  2.0  ! 2004-01 (C. Ethe, G. Madec)  Original code
-   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
+   !!            3.0  ! 2011-02 (G. Madec) dynamical allocation
    !!             -   ! 2014    (C. Rousset) add N/S initializations
    !!----------------------------------------------------------------------
@@ -25,4 +25,5 @@
    USE dom_ice          ! sea-ice domain
    USE limvar           ! lim_var_salprof
+   !
    USE in_out_manager   ! I/O manager
    USE lib_mpp          ! MPP library
@@ -37,5 +38,5 @@
    PUBLIC   lim_istate      ! routine called by lim_init.F90
 
-   !                          !!** init namelist (namiceini) **
+   !                           !!** init namelist (namiceini) **
    REAL(wp) ::   rn_thres_sst   ! threshold water temperature for initial sea ice
    REAL(wp) ::   rn_hts_ini_n   ! initial snow thickness in the north
@@ -57,5 +58,5 @@
    INTEGER , PARAMETER ::   jp_tmi = 5           ! index of ice temp at T-point
    INTEGER , PARAMETER ::   jp_smi = 6           ! index of ice sali at T-point
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   si    ! structure of input fields (file informations, fields read)
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   si  ! structure of input fields (file informations, fields read)
 
    LOGICAL  ::  ln_iceini        ! initialization or not
@@ -74,12 +75,10 @@
       !! ** Purpose :   defined the sea-ice initial state
       !!
-      !! ** Method  :   
-      !!                This routine will put some ice where ocean
+      !! ** Method  :   This routine will put some ice where ocean
       !!                is at the freezing point, then fill in ice 
       !!                state variables using prescribed initial 
       !!                values in the namelist            
       !!
-      !! ** Steps   :   
-      !!                1) Read namelist
+      !! ** Steps   :   1) Read namelist
       !!                2) Basal temperature; ice and hemisphere masks
       !!                3) Fill in the ice thickness distribution using gaussian
@@ -96,9 +95,7 @@
       !!   4.0  !  09-11  (M. Vancoppenolle)   Enhanced version for ice cats
       !!--------------------------------------------------------------------
-
-      !! * Local variables
-      INTEGER    :: ji, jj, jk, jl             ! dummy loop indices
-      REAL(wp)   :: ztmelts, zdh
-      INTEGER    :: i_hemis, i_fill, jl0  
+      INTEGER  :: ji, jj, jk, jl   ! dummy loop indices
+      REAL(wp) :: ztmelts, zdh
+      INTEGER  :: i_hemis, i_fill, jl0  
       REAL(wp)   :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv 
       REAL(wp), POINTER, DIMENSION(:,:)   :: zswitch    ! ice indicator
@@ -108,16 +105,16 @@
       !--------------------------------------------------------------------
 
-      CALL wrk_alloc( jpi, jpj, jpl, zh_i_ini,  za_i_ini,  zv_i_ini )
-      CALL wrk_alloc( jpi, jpj,      zht_i_ini, zat_i_ini, zvt_i_ini, zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini )
-      CALL wrk_alloc( jpi, jpj,      zswitch )
+      CALL wrk_alloc( jpi,jpj,jpl,   zh_i_ini,  za_i_ini,  zv_i_ini )
+      CALL wrk_alloc( jpi,jpj,       zht_i_ini, zat_i_ini, zvt_i_ini, zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini )
+      CALL wrk_alloc( jpi,jpj,       zswitch )
 
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization '
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
+      IF(lwp) WRITE(numout,*) 'lim_istate : sea-ice initialization '
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~ '
 
       !--------------------------------------------------------------------
       ! 1) Read namelist
       !--------------------------------------------------------------------
-
+      !
       CALL lim_istate_init     !  reading the initials parameters of the ice
 
@@ -134,9 +131,9 @@
 
       IF( ln_iceini ) THEN
-
+         !
          !--------------------------------------------------------------------
          ! 2) Basal temperature, ice mask and hemispheric index
          !--------------------------------------------------------------------
-
+         !
          DO jj = 1, jpj                                       ! ice if sst <= t-freez + ttest
             DO ji = 1, jpi
@@ -153,5 +150,5 @@
          !--------------------------------------------------------------------
          IF( ln_iceini_file )THEN
-
+            !
             zht_i_ini(:,:)  = si(jp_hti)%fnow(:,:,1)
             zht_s_ini(:,:)  = si(jp_hts)%fnow(:,:,1)
@@ -160,7 +157,7 @@
             ztm_i_ini(:,:)  = si(jp_tmi)%fnow(:,:,1)
             zsm_i_ini(:,:)  = si(jp_smi)%fnow(:,:,1)
-
+            !
          ELSE ! ln_iceini_file = F
-
+            !
             !-----------------------------
             ! 3.1) Hemisphere-dependent arrays
@@ -186,5 +183,5 @@
                END DO
             END DO
-
+            !
          ENDIF ! ln_iceini_file
 
@@ -200,17 +197,17 @@
          za_i_ini(:,:,:) = 0._wp
          zv_i_ini(:,:,:) = 0._wp
-
+         !
          DO jj = 1, jpj
             DO ji = 1, jpi
-
+               !
                IF( zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp )THEN
-
-                  ztest_1 = 0 ; ztest_2 = 0 ; ztest_3 = 0 ; ztest_4 = 0
+                  !
+                  ztest_1 = 0   ;   ztest_2 = 0   ;   ztest_3 = 0   ;   ztest_4 = 0
 !                  ztests  = 0 
-
+                  !
                   DO i_fill = jpl, 1, -1
-
-!                     IF( ztests .NE. 4 ) THEN
-                     IF ( ( ztest_1 + ztest_2 + ztest_3 + ztest_4 ) .NE. 4 ) THEN
+                     !
+!                     IF( ztests /= 4 ) THEN
+                     IF ( ( ztest_1 + ztest_2 + ztest_3 + ztest_4 ) /= 4 ) THEN
                         !----------------------------
                         ! fill the i_fill categories
@@ -223,5 +220,5 @@
                            za_i_ini(ji,jj,2:jpl)   = 0._wp
                         ELSE
-
+                           !
                            ! *** >1 categores to fill
                            !--- Ice thicknesses in the i_fill - 1 first categories
@@ -229,5 +226,5 @@
                               zh_i_ini(ji,jj,jl) = hi_mean(jl)
                            END DO
-               
+                           !
                            !--- jl0: most likely index where cc will be maximum
                            DO jl = 1, jpl
@@ -238,9 +235,9 @@
                            END DO
                            jl0 = MIN(jl0, i_fill)
-               
+                           !
                            !--- Concentrations
                            za_i_ini(ji,jj,jl0) = zat_i_ini(ji,jj) / SQRT(REAL(jpl))
                            DO jl = 1, i_fill - 1
-                              IF( jl .NE. jl0 )THEN
+                              IF( jl /= jl0 )THEN
                                  zsigma             = 0.5 * zht_i_ini(ji,jj)
                                  zarg               = ( zh_i_ini(ji,jj,jl) - zht_i_ini(ji,jj) ) / zsigma
@@ -248,5 +245,5 @@
                               ENDIF
                            END DO
-               
+                           !
                            zA = 0. ! sum of the areas in the jpl categories 
                            DO jl = 1, i_fill - 1
@@ -254,6 +251,6 @@
                            END DO
                            za_i_ini(ji,jj,i_fill)   = zat_i_ini(ji,jj) - zA ! ice conc in the last category
-                           IF ( i_fill .LT. jpl ) za_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
-         
+                           IF ( i_fill < jpl ) za_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
+                           !
                            !--- Ice thickness in the last category
                            zV = 0. ! sum of the volumes of the N-1 categories
@@ -262,12 +259,12 @@
                            END DO
                            zh_i_ini(ji,jj,i_fill) = ( zvt_i_ini(ji,jj) - zV ) / za_i_ini(ji,jj,i_fill) 
-                           IF ( i_fill .LT. jpl ) zh_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
-
+                           IF ( i_fill < jpl ) zh_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
+                           !
                            !--- volumes
                            zv_i_ini(ji,jj,:) = za_i_ini(ji,jj,:) * zh_i_ini(ji,jj,:)
-                           IF ( i_fill .LT. jpl ) zv_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
-
+                           IF ( i_fill < jpl ) zv_i_ini(ji,jj,i_fill+1:jpl) = 0._wp
+                           !
                         ENDIF ! i_fill
-
+                        !
                         !---------------------
                         ! Compatibility tests
@@ -275,59 +272,49 @@
                         ! Test 1: area conservation
                         zA_cons = SUM(za_i_ini(ji,jj,:)) ; zconv = ABS(zat_i_ini(ji,jj) - zA_cons )
-                        IF ( zconv .LT. 1.0e-6 ) THEN
-                           ztest_1 = 1
-                        ELSE 
-                          ztest_1 = 0
+                        IF( zconv < 1.0e-6 ) THEN   ;   ztest_1 = 1.
+                        ELSE                        ;   ztest_1 = 0.
                         ENDIF
-
+                        !
                         ! Test 2: volume conservation
                         zV_cons = SUM(zv_i_ini(ji,jj,:))
-                        zconv = ABS(zvt_i_ini(ji,jj) - zV_cons)
-
-                        IF( zconv .LT. 1.0e-6 ) THEN
-                           ztest_2 = 1
-                        ELSE
-                           ztest_2 = 0
+                        zconv   = ABS(zvt_i_ini(ji,jj) - zV_cons)
+                        IF( zconv < 1.0e-6 ) THEN   ;   ztest_2 = 1.
+                        ELSE                        ;   ztest_2 = 0.
                         ENDIF
-
+                        !
                         ! Test 3: thickness of the last category is in-bounds ?
-                        IF ( zh_i_ini(ji,jj,i_fill) > hi_max(i_fill-1) ) THEN
-                           ztest_3 = 1
-                        ELSE
-                           ztest_3 = 0
+                        IF( zh_i_ini(ji,jj,i_fill) > hi_max(i_fill-1) ) THEN   ;   ztest_3 = 1.
+                        ELSE                                                   ;   ztest_3 = 0.
                         ENDIF
-
+                        !
                         ! Test 4: positivity of ice concentrations
                         ztest_4 = 1
                         DO jl = 1, jpl
-                           IF ( za_i_ini(ji,jj,jl) .LT. 0._wp ) THEN 
-                              ztest_4 = 0
-                           ENDIF
+                           IF( za_i_ini(ji,jj,jl) < 0._wp )   ztest_4 = 0
                         END DO
-
+                        !
                      ENDIF ! ztest_1 + ztest_2 + ztest_3 + ztest_4
- 
+                     !
                      ztests = ztest_1 + ztest_2 + ztest_3 + ztest_4
-
+                     !
                   END DO ! i_fill
-
+                  !
                   IF(lwp) THEN 
-                     WRITE(numout,*) ' ztests : ', ztests
-                     IF( ztests .NE. 4 )THEN
+                     IF( ztests /= 4 ) THEN
                         WRITE(numout,*)
                         WRITE(numout,*) ' !!!! ALERT                  !!! '
                         WRITE(numout,*) ' !!!! Something is wrong in the LIM3 initialization procedure '
                         WRITE(numout,*)
-                        WRITE(numout,*) ' *** ztests is not equal to 4 '
+                        WRITE(numout,*) ' *** ztests is not equal to 4 :   ztests : ', ztests
                         WRITE(numout,*) ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4
                         WRITE(numout,*) ' zat_i_ini : ', zat_i_ini(ji,jj)
                         WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(ji,jj)
-                     ENDIF ! ztests .NE. 4
+                     ENDIF ! ztests /= 4
                   ENDIF
-      
+                  !
                ENDIF !  zat_i_ini(ji,jj) > 0._wp .AND. zhm_i_ini(ji,jj) > 0._wp
-
-            ENDDO   
-         ENDDO   
+               !
+            END DO   
+         END DO   
 
          !---------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 7280)
@@ -969,17 +969,18 @@
       IF (lwp) THEN                          ! control print
          WRITE(numout,*)
-         WRITE(numout,*)' lim_itd_me_init : ice parameters for mechanical ice redistribution '
-         WRITE(numout,*)' ~~~~~~~~~~~~~~~'
-         WRITE(numout,*)'   Fraction of shear energy contributing to ridging        rn_cs       = ', rn_cs 
-         WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrdg = ', rn_fsnowrdg 
-         WRITE(numout,*)'   Fraction of snow volume conserved during ridging        rn_fsnowrft = ', rn_fsnowrft 
-         WRITE(numout,*)'   Fraction of total ice coverage contributing to ridging  rn_gstar    = ', rn_gstar
-         WRITE(numout,*)'   Equivalent to G* for an exponential part function       rn_astar    = ', rn_astar
-         WRITE(numout,*)'   Quantity playing a role in max ridged ice thickness     rn_hstar    = ', rn_hstar
-         WRITE(numout,*)'   Rafting of ice sheets or not                            ln_rafting  = ', ln_rafting
-         WRITE(numout,*)'   Parmeter thickness (threshold between ridge-raft)       rn_hraft    = ', rn_hraft
-         WRITE(numout,*)'   Rafting hyperbolic tangent coefficient                  rn_craft    = ', rn_craft  
-         WRITE(numout,*)'   Initial porosity of ridges                              rn_por_rdg  = ', rn_por_rdg
-         WRITE(numout,*)'   Switch for part. function (0) linear (1) exponential    nn_partfun  = ', nn_partfun
+         WRITE(numout,*) ' lim_itd_me_init : ice parameters for mechanical ice redistribution '
+         WRITE(numout,*) ' ~~~~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namiceitdme :'
+         WRITE(numout,*) '      Fraction of shear energy contributing to ridging        rn_cs       = ', rn_cs 
+         WRITE(numout,*) '      Fraction of snow volume conserved during ridging        rn_fsnowrdg = ', rn_fsnowrdg 
+         WRITE(numout,*) '      Fraction of snow volume conserved during ridging        rn_fsnowrft = ', rn_fsnowrft 
+         WRITE(numout,*) '      Fraction of total ice coverage contributing to ridging  rn_gstar    = ', rn_gstar
+         WRITE(numout,*) '      Equivalent to G* for an exponential part function       rn_astar    = ', rn_astar
+         WRITE(numout,*) '      Quantity playing a role in max ridged ice thickness     rn_hstar    = ', rn_hstar
+         WRITE(numout,*) '      Rafting of ice sheets or not                            ln_rafting  = ', ln_rafting
+         WRITE(numout,*) '      Parmeter thickness (threshold between ridge-raft)       rn_hraft    = ', rn_hraft
+         WRITE(numout,*) '      Rafting hyperbolic tangent coefficient                  rn_craft    = ', rn_craft  
+         WRITE(numout,*) '      Initial porosity of ridges                              rn_por_rdg  = ', rn_por_rdg
+         WRITE(numout,*) '      Switch for part. function (0) linear (1) exponential    nn_partfun  = ', nn_partfun
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90	(revision 7280)
@@ -621,6 +621,6 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'lim_thd : Ice Thermodynamics'
-         WRITE(numout,*) '~~~~~~~'
+         WRITE(numout,*) 'lim_thd_init : Ice Thermodynamics initialization'
+         WRITE(numout,*) '~~~~~~~~~~~~'
       ENDIF
       !
@@ -634,12 +634,5 @@
       IF(lwm) WRITE ( numoni, namicethd )
       !
-      IF ( ( jpl > 1 ) .AND. ( nn_monocat == 1 ) ) THEN 
-         nn_monocat = 0
-         IF(lwp) WRITE(numout, *) '   nn_monocat must be 0 in multi-category case '
-      ENDIF
-
-      !
       IF(lwp) THEN                          ! control print
-         WRITE(numout,*)
          WRITE(numout,*)'   Namelist of ice parameters for ice thermodynamic computation '
          WRITE(numout,*)'      ice thick. for lateral accretion                        rn_hnewice   = ', rn_hnewice
@@ -659,4 +652,9 @@
          WRITE(numout,*)'      iterate the surface non-solar flux (T) or not (F)       ln_it_qnsice = ', ln_it_qnsice
       ENDIF
+      IF( jpl > 1 .AND. nn_monocat == 1 ) THEN 
+         nn_monocat = 0
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '   nn_monocat forced to 0 as jpl>1, i.e. multi-category case is chosen'
+      ENDIF
       !
    END SUBROUTINE lim_thd_init
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 7280)
@@ -144,12 +144,13 @@
          WRITE(numout,*) 'lim_thd_sal_init : Ice parameters for salinity '
          WRITE(numout,*) '~~~~~~~~~~~~~~~~'
-         WRITE(numout,*) '   switch for salinity nn_icesal        = ', nn_icesal
-         WRITE(numout,*) '   bulk salinity value if nn_icesal = 1 = ', rn_icesal
-         WRITE(numout,*) '   restoring salinity for GD            = ', rn_sal_gd
-         WRITE(numout,*) '   restoring time for GD                = ', rn_time_gd
-         WRITE(numout,*) '   restoring salinity for flushing      = ', rn_sal_fl
-         WRITE(numout,*) '   restoring time for flushing          = ', rn_time_fl
-         WRITE(numout,*) '   Maximum tolerated ice salinity       = ', rn_simax
-         WRITE(numout,*) '   Minimum tolerated ice salinity       = ', rn_simin
+         WRITE(numout,*) '   Namelist namicesal :'
+         WRITE(numout,*) '      switch for salinity nn_icesal        = ', nn_icesal
+         WRITE(numout,*) '      bulk salinity value if nn_icesal = 1 = ', rn_icesal
+         WRITE(numout,*) '      restoring salinity for GD            = ', rn_sal_gd
+         WRITE(numout,*) '      restoring time for GD                = ', rn_time_gd
+         WRITE(numout,*) '      restoring salinity for flushing      = ', rn_sal_fl
+         WRITE(numout,*) '      restoring time for flushing          = ', rn_time_fl
+         WRITE(numout,*) '      Maximum tolerated ice salinity       = ', rn_simax
+         WRITE(numout,*) '      Minimum tolerated ice salinity       = ', rn_simin
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 7280)
@@ -230,98 +230,98 @@
 
    SUBROUTINE dia_hsb_rst( kt, cdrw )
-     !!---------------------------------------------------------------------
-     !!                   ***  ROUTINE limdia_rst  ***
-     !!                     
-     !! ** Purpose :   Read or write DIA file in restart file
-     !!
-     !! ** Method  :   use of IOM library
-     !!----------------------------------------------------------------------
-     INTEGER         , INTENT(in) ::   kt     ! ocean time-step
-     CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag
-     !
-     INTEGER ::   ji, jj, jk   ! dummy loop indices
-     INTEGER ::   id1          ! local integers
-     !!----------------------------------------------------------------------
-     !
-     IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
-        IF( ln_rstart ) THEN                   !* Read the restart file
-           !id1 = iom_varid( numror, 'frc_vol'  , ldstop = .FALSE. )
-           !
-           IF(lwp) WRITE(numout,*) '~~~~~~~'
-           IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp
-           IF(lwp) WRITE(numout,*) '~~~~~~~'
-           CALL iom_get( numror, 'frc_v', frc_v )
-           CALL iom_get( numror, 'frc_t', frc_t )
-           CALL iom_get( numror, 'frc_s', frc_s )
-           IF( ln_linssh ) THEN
-              CALL iom_get( numror, 'frc_wn_t', frc_wn_t )
-              CALL iom_get( numror, 'frc_wn_s', frc_wn_s )
-           ENDIF
-           CALL iom_get( numror, jpdom_autoglo, 'surf_ini', surf_ini ) ! ice sheet coupling
-           CALL iom_get( numror, jpdom_autoglo, 'ssh_ini', ssh_ini )
-           CALL iom_get( numror, jpdom_autoglo, 'e3t_ini', e3t_ini )
-           CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini )
-           CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini )
-           IF( ln_linssh ) THEN
-              CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
-              CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
-           ENDIF
-       ELSE
-          IF(lwp) WRITE(numout,*) '~~~~~~~'
-          IF(lwp) WRITE(numout,*) ' dia_hsb at initial state '
-          IF(lwp) WRITE(numout,*) '~~~~~~~'
-          surf_ini(:,:) = e1e2t(:,:) * tmask_i(:,:)         ! initial ocean surface
-          ssh_ini(:,:) = sshn(:,:)                          ! initial ssh
-          DO jk = 1, jpk
-             ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance).
-             e3t_ini   (:,:,jk) = e3t_n(:,:,jk)                      * tmask(:,:,jk)  ! initial vertical scale factors
-             hc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_tem) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial heat content
-             sc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_sal) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial salt content
-          END DO
-          frc_v = 0._wp                                           ! volume       trend due to forcing
-          frc_t = 0._wp                                           ! heat content   -    -   -    -   
-          frc_s = 0._wp                                           ! salt content   -    -   -    -        
-          IF( ln_linssh ) THEN
-             IF ( ln_isfcav ) THEN
-                DO ji=1,jpi
-                   DO jj=1,jpj
-                      ssh_hc_loc_ini(ji,jj) = tsn(ji,jj,mikt(ji,jj),jp_tem) * sshn(ji,jj)   ! initial heat content in ssh
-                      ssh_sc_loc_ini(ji,jj) = tsn(ji,jj,mikt(ji,jj),jp_sal) * sshn(ji,jj)   ! initial salt content in ssh
-                   ENDDO
-                ENDDO
-             ELSE
-                ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:)   ! initial heat content in ssh
-                ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * sshn(:,:)   ! initial salt content in ssh
-             END IF
-             frc_wn_t = 0._wp                                       ! initial heat content misfit due to free surface
-             frc_wn_s = 0._wp                                       ! initial salt content misfit due to free surface
-          ENDIF
-       ENDIF
-
-     ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
-        !                                   ! -------------------
-        IF(lwp) WRITE(numout,*) '~~~~~~~'
-        IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp
-        IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-        CALL iom_rstput( kt, nitrst, numrow, 'frc_v'   , frc_v     )
-        CALL iom_rstput( kt, nitrst, numrow, 'frc_t'   , frc_t     )
-        CALL iom_rstput( kt, nitrst, numrow, 'frc_s'   , frc_s     )
-        IF( ln_linssh ) THEN
-           CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t )
-           CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s )
-        ENDIF
-        CALL iom_rstput( kt, nitrst, numrow, 'surf_ini', surf_ini )      ! ice sheet coupling
-        CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini', ssh_ini )
-        CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini', e3t_ini )
-        CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini )
-        CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini )
-        IF( ln_linssh ) THEN
-           CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
-           CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
-        ENDIF
-        !
-     ENDIF
-     !
+      !!---------------------------------------------------------------------
+      !!                   ***  ROUTINE limdia_rst  ***
+      !!                     
+      !! ** Purpose :   Read or write DIA file in restart file
+      !! 
+      !! ** Method  :   use of IOM library
+      !!----------------------------------------------------------------------
+      INTEGER         , INTENT(in) ::   kt     ! ocean time-step
+      CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag
+      !
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      INTEGER ::   id1          ! local integers
+      !!----------------------------------------------------------------------
+      !
+      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
+         IF( ln_rstart ) THEN                   !* Read the restart file
+            !id1 = iom_varid( numror, 'frc_vol'  , ldstop = .FALSE. )
+            !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) '   dia_hsb_rst : read restart at it= ', kt,' date= ', ndastp
+            IF(lwp) WRITE(numout,*) '   ~~~~~~~~~~~'
+            CALL iom_get( numror, 'frc_v', frc_v )
+            CALL iom_get( numror, 'frc_t', frc_t )
+            CALL iom_get( numror, 'frc_s', frc_s )
+            IF( ln_linssh ) THEN
+               CALL iom_get( numror, 'frc_wn_t', frc_wn_t )
+               CALL iom_get( numror, 'frc_wn_s', frc_wn_s )
+            ENDIF
+            CALL iom_get( numror, jpdom_autoglo, 'surf_ini', surf_ini ) ! ice sheet coupling
+            CALL iom_get( numror, jpdom_autoglo, 'ssh_ini', ssh_ini )
+            CALL iom_get( numror, jpdom_autoglo, 'e3t_ini', e3t_ini )
+            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini )
+            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini )
+            IF( ln_linssh ) THEN
+               CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
+               CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
+            ENDIF
+         ELSE
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) '   dia_hsb_rst : no restart, set value at initial state '
+            IF(lwp) WRITE(numout,*) '   ~~~~~~~~~~~'
+            surf_ini(:,:) = e1e2t(:,:) * tmask_i(:,:)         ! initial ocean surface
+            ssh_ini(:,:) = sshn(:,:)                          ! initial ssh
+            DO jk = 1, jpk
+               ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance).
+               e3t_ini   (:,:,jk) = e3t_n(:,:,jk)                      * tmask(:,:,jk)  ! initial vertical scale factors
+               hc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_tem) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial heat content
+               sc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_sal) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial salt content
+            END DO
+            frc_v = 0._wp                                           ! volume       trend due to forcing
+            frc_t = 0._wp                                           ! heat content   -    -   -    -   
+            frc_s = 0._wp                                           ! salt content   -    -   -    -        
+            IF( ln_linssh ) THEN
+               IF( ln_isfcav ) THEN
+                  DO ji=1,jpi
+                     DO jj=1,jpj
+                        ssh_hc_loc_ini(ji,jj) = tsn(ji,jj,mikt(ji,jj),jp_tem) * sshn(ji,jj)   ! initial heat content in ssh
+                        ssh_sc_loc_ini(ji,jj) = tsn(ji,jj,mikt(ji,jj),jp_sal) * sshn(ji,jj)   ! initial salt content in ssh
+                     END DO
+                  END DO
+               ELSE
+                  ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:)   ! initial heat content in ssh
+                  ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * sshn(:,:)   ! initial salt content in ssh
+               END IF
+               frc_wn_t = 0._wp                                       ! initial heat content misfit due to free surface
+               frc_wn_s = 0._wp                                       ! initial salt content misfit due to free surface
+            ENDIF
+         ENDIF
+         !
+      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
+         !                                   ! -------------------
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '   dia_hsb_rst : write restart at it= ', kt,' date= ', ndastp
+         IF(lwp) WRITE(numout,*) '   ~~~~~~~~~~~'
+
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_v'   , frc_v     )
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_t'   , frc_t     )
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_s'   , frc_s     )
+         IF( ln_linssh ) THEN
+            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t )
+            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s )
+         ENDIF
+         CALL iom_rstput( kt, nitrst, numrow, 'surf_ini', surf_ini )      ! ice sheet coupling
+         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini', ssh_ini )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini', e3t_ini )
+         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini )
+         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini )
+         IF( ln_linssh ) THEN
+            CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
+            CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
+         ENDIF
+         !
+      ENDIF
+      !
    END SUBROUTINE dia_hsb_rst
 
@@ -342,14 +342,8 @@
       INTEGER ::   ierror   ! local integer
       INTEGER ::   ios
-      !
+      !!
       NAMELIST/namhsb/ ln_diahsb
       !!----------------------------------------------------------------------
-
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'dia_hsb_init : check the heat and salt budgets'
-         WRITE(numout,*) '~~~~~~~~ '
-      ENDIF
-
+      !
       REWIND( numnam_ref )              ! Namelist namhsb in reference namelist
       READ  ( numnam_ref, namhsb, IOSTAT = ios, ERR = 901)
@@ -368,12 +362,7 @@
          WRITE(numout,*) '   Namelist namhsb : set hsb parameters'
          WRITE(numout,*) '      Switch for hsb diagnostic (T) or not (F)  ln_diahsb  = ', ln_diahsb
-         WRITE(numout,*)
       ENDIF
 
       IF( .NOT. ln_diahsb )   RETURN
-         !      IF( .NOT. lk_mpp_rep ) &
-         !        CALL ctl_stop (' Your global mpp_sum if performed in single precision - 64 bits -', &
-         !             &         ' whereas the global sum to be precise must be done in double precision ',&
-         !             &         ' please add key_mpp_rep')
 
       ! ------------------- !
@@ -383,10 +372,10 @@
          &      e3t_ini(jpi,jpj,jpk), surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror  )
       IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN
+         CALL ctl_stop( 'dia_hsb_init: unable to allocate hc_loc_ini' )   ;   RETURN
       ENDIF
 
       IF( ln_linssh )   ALLOCATE( ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj),STAT=ierror )
       IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN
+         CALL ctl_stop( 'dia_hsb_init: unable to allocate hc_loc_ini' )   ;   RETURN
       ENDIF
 
@@ -394,10 +383,10 @@
       ! 2 - Time independant variables and file opening !
       ! ----------------------------------------------- !
-      IF(lwp) WRITE(numout,*) "dia_hsb: heat salt volume budgets activated"
-      IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) "   heat salt volume budgets activated"
       surf(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:)      ! masked surface grid cell area
       surf_tot  = glob_sum( surf(:,:) )                                       ! total ocean surface area
 
-      IF( lk_bdy ) CALL ctl_warn( 'dia_hsb does not take open boundary fluxes into account' )         
+      IF( lk_bdy ) CALL ctl_warn( 'dia_hsb_init: heat/salt budget does not consider open boundary fluxes' )         
       !
       ! ---------------------------------- !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/cool_skin.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/cool_skin.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/cool_skin.F90	(revision 7280)
@@ -10,5 +10,6 @@
 
    !!----------------------------------------------------------------------
-   !!   diurnal_sst_coolskin_step  : time-step the cool skin corrections
+   !!   diurnal_sst_coolskin_init : initialisation of the cool skin
+   !!   diurnal_sst_coolskin_step : time-stepping  of the cool skin corrections
    !!----------------------------------------------------------------------
    USE par_kind
@@ -21,5 +22,6 @@
    
    IMPLICIT NONE
-   
+   PRIVATE
+
    ! Namelist parameters
 
@@ -37,10 +39,13 @@
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: x_csthick   ! Cool skin thickness
 
-   PRIVATE
    PUBLIC diurnal_sst_coolskin_step, diurnal_sst_coolskin_init
 
       !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
-   
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO-consortium (2016) 
+   !! $Id:  $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------   
    CONTAINS 
    
@@ -56,13 +61,11 @@
       !! 
       !!----------------------------------------------------------------------
-      
-      IMPLICIT NONE
-      
       ALLOCATE( x_csdsst(jpi,jpj), x_csthick(jpi,jpj) )
       x_csdsst = 0.
       x_csthick = 0.
-      
+      !
    END SUBROUTINE diurnal_sst_coolskin_init
- 
+
+
    SUBROUTINE diurnal_sst_coolskin_step(psqflux, pstauflux, psrho, rdt)
       !!----------------------------------------------------------------------
@@ -75,7 +78,4 @@
       !! ** Reference : 
       !!----------------------------------------------------------------------
-     
-      IMPLICIT NONE
-     
       ! Dummy variables
       REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: psqflux     ! Heat (non-solar)(Watts)
@@ -94,13 +94,11 @@
      
       INTEGER :: ji,jj
-     
-      IF ( .NOT. ln_blk_core ) THEN
-         CALL ctl_stop("cool_skin.f90: diurnal flux processing only implemented"//&
-         &             " for core bulk forcing")
-      ENDIF
- 
+      !!----------------------------------------------------------------------
+      !
+      IF( .NOT. ln_blk )   CALL ctl_stop("cool_skin.f90: diurnal flux processing only implemented for bulk forcing")
+      !
       DO jj = 1,jpj
          DO ji = 1,jpi
-            
+            !
             ! Calcualte wind speed from wind stress and friction velocity
             IF( tmask(ji,jj,1) == 1. .AND. pstauflux(ji,jj) /= 0 .AND. psrho(ji,jj) /=0 ) THEN
@@ -111,6 +109,5 @@
                z_wspd(ji,jj) = 0.     
             ENDIF
-
- 
+            !
             ! Calculate gamma function which is dependent upon wind speed
             IF( tmask(ji,jj,1) == 1. ) THEN
@@ -119,6 +116,5 @@
                IF( ( z_wspd(ji,jj) >= 10. ) ) z_gamma(ji,jj) = 6.
             ENDIF
-
-
+            !
             ! Calculate lamda function
             IF( tmask(ji,jj,1) == 1. .AND. z_fv(ji,jj) /= 0 ) THEN
@@ -127,16 +123,12 @@
                z_lamda(ji,jj) = 0.
             ENDIF
-
-
-
+            !
             ! Calculate the cool skin thickness - only when heat flux is out of the ocean
             IF( tmask(ji,jj,1) == 1. .AND. z_fv(ji,jj) /= 0 .AND. psqflux(ji,jj) < 0 ) THEN
-                x_csthick(ji,jj) = ( z_lamda(ji,jj) * pp_v ) / z_fv(ji,jj)
+               x_csthick(ji,jj) = ( z_lamda(ji,jj) * pp_v ) / z_fv(ji,jj)
             ELSE
-                x_csthick(ji,jj) = 0.
+               x_csthick(ji,jj) = 0.
             ENDIF
-
-
-
+            !
             ! Calculate the cool skin correction - only when the heat flux is out of the ocean
             IF( tmask(ji,jj,1) == 1. .AND. x_csthick(ji,jj) /= 0. .AND. psqflux(ji,jj) < 0. ) THEN
@@ -145,10 +137,10 @@
                x_csdsst(ji,jj) = 0.
             ENDIF
-
-         ENDDO
-      ENDDO
-
+            !
+         END DO
+      END DO
+      !
    END SUBROUTINE diurnal_sst_coolskin_step
 
-
+   !!======================================================================
 END MODULE cool_skin
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90	(revision 7280)
@@ -64,10 +64,7 @@
      
       ! Cool skin
-      IF ( .NOT.ln_diurnal ) CALL ctl_stop(  "stp_diurnal: ln_diurnal not set"  )
+      IF( .NOT.ln_diurnal )   CALL ctl_stop( "stp_diurnal: ln_diurnal not set" )
          
-      IF ( .NOT. ln_blk_core ) THEN
-         CALL ctl_stop("step.f90: diurnal flux processing only implemented"//&
-         &             " for core forcing") 
-      ENDIF
+      IF( .NOT. ln_blk    )   CALL ctl_stop( "stp_diurnal: diurnal flux processing only implemented for bulk forcing" ) 
 
       CALL diurnal_sst_coolskin_step( qns, taum, rhop(:,:,1), rdt)
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 7280)
@@ -53,6 +53,6 @@
       LOGICAL, INTENT(in), OPTIONAL ::   ld_tradmp   ! force the initialization when tradp is used
       !
-      INTEGER ::   ierr0, ierr1, ierr2, ierr3   ! temporary integers
-      !
+      INTEGER ::   ios, ierr0, ierr1, ierr2, ierr3   ! local integers
+      !!
       CHARACTER(len=100)            ::   cn_dir          ! Root directory for location of ssr files
       TYPE(FLD_N), DIMENSION( jpts) ::   slf_i           ! array of namelist informations on the fields to read
@@ -60,5 +60,4 @@
       !!
       NAMELIST/namtsd/   ln_tsd_init, ln_tsd_tradmp, cn_dir, sn_tem, sn_sal
-      INTEGER  ::   ios
       !!----------------------------------------------------------------------
       !
@@ -117,5 +116,5 @@
          !                         ! fill sf_tsd with sn_tem & sn_sal and control print
          slf_i(jp_tem) = sn_tem   ;   slf_i(jp_sal) = sn_sal
-         CALL fld_fill( sf_tsd, slf_i, cn_dir, 'dta_tsd', 'Temperature & Salinity data', 'namtsd' )
+         CALL fld_fill( sf_tsd, slf_i, cn_dir, 'dta_tsd', 'Temperature & Salinity data', 'namtsd', no_print )
          !
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DOM/phycst.F90	(revision 7280)
@@ -104,6 +104,6 @@
 
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) ' phy_cst : initialization of physical constants'
-      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
+      IF(lwp) WRITE(numout,*) 'phy_cst : initialization of ocean parameters and constants'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
 
       ! Define & print constants
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 7280)
@@ -106,11 +106,11 @@
          WRITE(numout,*)
          WRITE(numout,*) 'dyn_adv_init : choice/control of the momentum advection scheme'
-         WRITE(numout,*) '~~~~~~~~~~~'
-         WRITE(numout,*) '       Namelist namdyn_adv : chose a advection formulation & scheme for momentum'
-         WRITE(numout,*) '          Vector/flux form (T/F)                           ln_dynadv_vec  = ', ln_dynadv_vec
-         WRITE(numout,*) '          = 0 standard scheme  ; =1 Hollingsworth scheme   nn_dynkeg      = ', nn_dynkeg
-         WRITE(numout,*) '          2nd order centred advection scheme               ln_dynadv_cen2 = ', ln_dynadv_cen2
-         WRITE(numout,*) '          3rd order UBS advection scheme                   ln_dynadv_ubs  = ', ln_dynadv_ubs
-         WRITE(numout,*) '          Sub timestepping of vertical advection           ln_dynzad_zts  = ', ln_dynzad_zts
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namdyn_adv : chose a advection formulation & scheme for momentum'
+         WRITE(numout,*) '      Vector/flux form (T/F)                           ln_dynadv_vec  = ', ln_dynadv_vec
+         WRITE(numout,*) '      = 0 standard scheme  ; =1 Hollingsworth scheme   nn_dynkeg      = ', nn_dynkeg
+         WRITE(numout,*) '      2nd order centred advection scheme               ln_dynadv_cen2 = ', ln_dynadv_cen2
+         WRITE(numout,*) '      3rd order UBS advection scheme                   ln_dynadv_ubs  = ', ln_dynadv_ubs
+         WRITE(numout,*) '      Sub timestepping of vertical advection           ln_dynzad_zts  = ', ln_dynzad_zts
       ENDIF
 
@@ -134,12 +134,12 @@
       IF(lwp) THEN                    ! Print the choice
          WRITE(numout,*)
-         IF( nadv ==  0 )   WRITE(numout,*) '         vector form : keg + zad + vor is used' 
-         IF( nadv ==  1 )   WRITE(numout,*) '         vector form : keg + zad_zts + vor is used'
+         IF( nadv ==  0 )   WRITE(numout,*) '      ===>>   vector form : keg + zad + vor is used' 
+         IF( nadv ==  1 )   WRITE(numout,*) '      ===>>   vector form : keg + zad_zts + vor is used'
          IF( nadv ==  0 .OR. nadv ==  1 ) THEN
-            IF( nn_dynkeg == nkeg_C2  )   WRITE(numout,*) 'with Centered standard keg scheme'
-            IF( nn_dynkeg == nkeg_HW  )   WRITE(numout,*) 'with Hollingsworth keg scheme'
+            IF( nn_dynkeg == nkeg_C2  )   WRITE(numout,*) '              with Centered standard keg scheme'
+            IF( nn_dynkeg == nkeg_HW  )   WRITE(numout,*) '              with Hollingsworth keg scheme'
          ENDIF
-         IF( nadv ==  2 )   WRITE(numout,*) '         flux form   : 2nd order scheme is used'
-         IF( nadv ==  3 )   WRITE(numout,*) '         flux form   : UBS       scheme is used'
+         IF( nadv ==  2 )   WRITE(numout,*) '      ===>>   flux form   : 2nd order scheme is used'
+         IF( nadv ==  3 )   WRITE(numout,*) '      ===>>   flux form   : UBS       scheme is used'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 7280)
@@ -110,11 +110,11 @@
          WRITE(numout,*)
          WRITE(numout,*) 'dyn_ldf_init : Choice of the lateral diffusive operator on dynamics'
-         WRITE(numout,*) '~~~~~~~~~~~'
-         WRITE(numout,*) '       Namelist nam_dynldf : set lateral mixing parameters (type, direction, coefficients)'
-         WRITE(numout,*) '          laplacian operator          ln_dynldf_lap = ', ln_dynldf_lap
-         WRITE(numout,*) '          bilaplacian operator        ln_dynldf_blp = ', ln_dynldf_blp
-         WRITE(numout,*) '          iso-level                   ln_dynldf_lev = ', ln_dynldf_lev
-         WRITE(numout,*) '          horizontal (geopotential)   ln_dynldf_hor = ', ln_dynldf_hor
-         WRITE(numout,*) '          iso-neutral                 ln_dynldf_iso = ', ln_dynldf_iso
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist nam_dynldf : set lateral mixing parameters (type, direction, coefficients)'
+         WRITE(numout,*) '      laplacian operator          ln_dynldf_lap = ', ln_dynldf_lap
+         WRITE(numout,*) '      bilaplacian operator        ln_dynldf_blp = ', ln_dynldf_blp
+         WRITE(numout,*) '      iso-level                   ln_dynldf_lev = ', ln_dynldf_lev
+         WRITE(numout,*) '      horizontal (geopotential)   ln_dynldf_hor = ', ln_dynldf_hor
+         WRITE(numout,*) '      iso-neutral                 ln_dynldf_iso = ', ln_dynldf_iso
       ENDIF
       !                                   ! use of lateral operator or not
@@ -180,8 +180,8 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         IF( nldf == np_no_ldf )   WRITE(numout,*) '              NO lateral viscosity'
-         IF( nldf == np_lap    )   WRITE(numout,*) '              iso-level laplacian operator'
-         IF( nldf == np_lap_i  )   WRITE(numout,*) '              rotated laplacian operator with iso-level background'
-         IF( nldf == np_blp    )   WRITE(numout,*) '              iso-level bi-laplacian operator'
+         IF( nldf == np_no_ldf )   WRITE(numout,*) '      ===>>   NO lateral viscosity'
+         IF( nldf == np_lap    )   WRITE(numout,*) '      ===>>   iso-level laplacian operator'
+         IF( nldf == np_lap_i  )   WRITE(numout,*) '      ===>>   rotated laplacian operator with iso-level background'
+         IF( nldf == np_blp    )   WRITE(numout,*) '      ===>>   iso-level bi-laplacian operator'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 7280)
@@ -216,7 +216,7 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         IF( nspg == np_EXP )   WRITE(numout,*) '     explicit free surface'
-         IF( nspg == np_TS  )   WRITE(numout,*) '     free surface with time splitting scheme'
-         IF( nspg == np_NO  )   WRITE(numout,*) '     No surface surface pressure gradient trend in momentum Eqs.'
+         IF( nspg == np_EXP )   WRITE(numout,*) '      ===>>   explicit free surface'
+         IF( nspg == np_TS  )   WRITE(numout,*) '      ===>>   free surface with time splitting scheme'
+         IF( nspg == np_NO  )   WRITE(numout,*) '      ===>>   No surface surface pressure gradient trend in momentum Eqs.'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 7280)
@@ -626,11 +626,11 @@
          WRITE(numout,*) 'dyn_vor_init : vorticity term : read namelist and control the consistency'
          WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) '        Namelist namdyn_vor : choice of the vorticity term scheme'
-         WRITE(numout,*) '           energy    conserving scheme                    ln_dynvor_ene = ', ln_dynvor_ene
-         WRITE(numout,*) '           enstrophy conserving scheme                    ln_dynvor_ens = ', ln_dynvor_ens
-         WRITE(numout,*) '           mixed enstrophy/energy conserving scheme       ln_dynvor_mix = ', ln_dynvor_mix
-         WRITE(numout,*) '           enstrophy and energy conserving scheme         ln_dynvor_een = ', ln_dynvor_een
-         WRITE(numout,*) '              e3f = averaging /4 (=0) or /sum(tmask) (=1)    nn_een_e3f = ', nn_een_e3f
-         WRITE(numout,*) '           masked (=T) or unmasked(=F) vorticity          ln_dynvor_msk = ', ln_dynvor_msk
+         WRITE(numout,*) '   Namelist namdyn_vor : choice of the vorticity term scheme'
+         WRITE(numout,*) '      energy    conserving scheme                    ln_dynvor_ene = ', ln_dynvor_ene
+         WRITE(numout,*) '      enstrophy conserving scheme                    ln_dynvor_ens = ', ln_dynvor_ens
+         WRITE(numout,*) '      mixed enstrophy/energy conserving scheme       ln_dynvor_mix = ', ln_dynvor_mix
+         WRITE(numout,*) '      enstrophy and energy conserving scheme         ln_dynvor_een = ', ln_dynvor_een
+         WRITE(numout,*) '         e3f = averaging /4 (=0) or /sum(tmask) (=1)    nn_een_e3f = ', nn_een_e3f
+         WRITE(numout,*) '      masked (=T) or unmasked(=F) vorticity          ln_dynvor_msk = ', ln_dynvor_msk
       ENDIF
 
@@ -639,5 +639,5 @@
       ! at angles with three ocean points and one land point
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '           namlbc: change fmask value in the angles (T)   ln_vorlat = ', ln_vorlat
+      IF(lwp) WRITE(numout,*) '      change fmask value in the angles (T)           ln_vorlat = ', ln_vorlat
       IF( ln_vorlat .AND. ( ln_dynvor_ene .OR. ln_dynvor_ens .OR. ln_dynvor_mix ) ) THEN
          DO jk = 1, jpk
@@ -666,9 +666,9 @@
       ncor = np_COR
       IF( ln_dynadv_vec ) THEN     
-         IF(lwp) WRITE(numout,*) '         Vector form advection : vorticity = Coriolis + relative vorticity'
+         IF(lwp) WRITE(numout,*) '      ===>>   Vector form advection : vorticity = Coriolis + relative vorticity'
          nrvm = np_RVO        ! relative vorticity
          ntot = np_CRV        ! relative + planetary vorticity
       ELSE                        
-         IF(lwp) WRITE(numout,*) '         Flux form advection   : vorticity = Coriolis + metric term'
+         IF(lwp) WRITE(numout,*) '      ===>>   Flux form advection   : vorticity = Coriolis + metric term'
          nrvm = np_MET        ! metric term
          ntot = np_CME        ! Coriolis + metric term
@@ -677,8 +677,8 @@
       IF(lwp) THEN                   ! Print the choice
          WRITE(numout,*)
-         IF( nvor_scheme ==  np_ENE )   WRITE(numout,*) '         vorticity scheme ==>> energy conserving scheme'
-         IF( nvor_scheme ==  np_ENS )   WRITE(numout,*) '         vorticity scheme ==>> enstrophy conserving scheme'
-         IF( nvor_scheme ==  np_MIX )   WRITE(numout,*) '         vorticity scheme ==>> mixed enstrophy/energy conserving scheme'
-         IF( nvor_scheme ==  np_EEN )   WRITE(numout,*) '         vorticity scheme ==>> energy and enstrophy conserving scheme'
+         IF( nvor_scheme ==  np_ENE )   WRITE(numout,*) '      ===>>   energy conserving scheme'
+         IF( nvor_scheme ==  np_ENS )   WRITE(numout,*) '      ===>>   enstrophy conserving scheme'
+         IF( nvor_scheme ==  np_MIX )   WRITE(numout,*) '      ===>>   mixed enstrophy/energy conserving scheme'
+         IF( nvor_scheme ==  np_EEN )   WRITE(numout,*) '      ===>>   energy and enstrophy conserving scheme'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90	(revision 7280)
@@ -119,6 +119,6 @@
          WRITE(numout,*) 'dyn_zdf_init : vertical dynamics physics scheme'
          WRITE(numout,*) '~~~~~~~~~~~'
-         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme'
-         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme'
+         IF( nzdf ==  0 )   WRITE(numout,*) '      ===>>   Explicit time-splitting scheme'
+         IF( nzdf ==  1 )   WRITE(numout,*) '      ===>>   Implicit (euler backward) scheme'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/DYN/wet_dry.F90	(revision 7280)
@@ -75,5 +75,5 @@
          WRITE(numout,*)
          WRITE(numout,*) 'wad_init : Wetting and drying initialization through namelist read'
-         WRITE(numout,*) '~~~~~~~ '
+         WRITE(numout,*) '~~~~~~~~'
          WRITE(numout,*) '   Namelist namwad'
          WRITE(numout,*) '      Logical activation                 ln_wd      = ', ln_wd
@@ -268,6 +268,6 @@
       REAL(wp) ::   ztmp                ! local scalars
       REAL(wp), POINTER,  DIMENSION(:,:) ::   zwdlmtu, zwdlmtv         !: W/D flux limiters
-      REAL(wp), POINTER,  DIMENSION(:,:) ::   zflxp,  zflxn            ! 2D workspace
-      REAL(wp), POINTER,  DIMENSION(:,:) ::   zflxu1, zflxv1           ! 2D workspace
+      REAL(wp), POINTER,  DIMENSION(:,:) ::   zflxp,  zflxn            ! local 2D workspace
+      REAL(wp), POINTER,  DIMENSION(:,:) ::   zflxu1, zflxv1           ! local 2D workspace
       !!----------------------------------------------------------------------
       !
@@ -390,5 +390,5 @@
       !
    END SUBROUTINE wad_lmt_bt
-   
+
    !!==============================================================================
 END MODULE wet_dry
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 7280)
@@ -372,7 +372,7 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'icbini :   AGRIF is not compatible with namelist namberg :  '
-         WRITE(numout,*) '         definition of rn_initial_mass(nclasses) with nclasses as PARAMETER '
-         WRITE(numout,*) ' namelist namberg not read'
+         WRITE(numout,*) 'icbini : AGRIF is not compatible with namelist namberg :  '
+         WRITE(numout,*) '~~~~~~   definition of rn_initial_mass(nclasses) with nclasses as PARAMETER '
+         WRITE(numout,*) '         ==>>>   force  NO icebergs used. The namelist namberg is not read'
       ENDIF
       ln_icebergs = .false.      
@@ -381,6 +381,6 @@
          IF(lwp) THEN
             WRITE(numout,*)
-            WRITE(numout,*) 'icbini :   Namelist namberg ln_icebergs = F , NO icebergs used'
-            WRITE(numout,*) '~~~~~~~~ '
+            WRITE(numout,*) 'icbini : Namelist namberg ln_icebergs = F , NO icebergs used'
+            WRITE(numout,*) '~~~~~~ '
          ENDIF
          RETURN
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 7280)
@@ -17,5 +17,5 @@
    IMPLICIT NONE
    PUBLIC
- 
+
    !!----------------------------------------------------------------------
    !!                   namrun namelist parameters
@@ -95,16 +95,16 @@
    !!                    output monitoring
    !!----------------------------------------------------------------------
-   LOGICAL ::   ln_ctl       !: run control for debugging
-   INTEGER ::   nn_timing    !: run control for timing
-   INTEGER ::   nn_diacfl    !: flag whether to create CFL diagnostics
-   INTEGER ::   nn_print     !: level of print (0 no print)
-   INTEGER ::   nn_ictls     !: Start i indice for the SUM control
-   INTEGER ::   nn_ictle     !: End   i indice for the SUM control
-   INTEGER ::   nn_jctls     !: Start j indice for the SUM control
-   INTEGER ::   nn_jctle     !: End   j indice for the SUM control
-   INTEGER ::   nn_isplt     !: number of processors following i
-   INTEGER ::   nn_jsplt     !: number of processors following j
-   INTEGER ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1)
-
+   LOGICAL ::   ln_ctl           !: run control for debugging
+   INTEGER ::   nn_timing        !: run control for timing
+   INTEGER ::   nn_diacfl        !: flag whether to create CFL diagnostics
+   INTEGER ::   nn_print         !: level of print (0 no print)
+   INTEGER ::   nn_ictls         !: Start i indice for the SUM control
+   INTEGER ::   nn_ictle         !: End   i indice for the SUM control
+   INTEGER ::   nn_jctls         !: Start j indice for the SUM control
+   INTEGER ::   nn_jctle         !: End   j indice for the SUM control
+   INTEGER ::   nn_isplt         !: number of processors following i
+   INTEGER ::   nn_jsplt         !: number of processors following j
+   INTEGER ::   nn_bench         !: benchmark parameter (0/1)
+   INTEGER ::   nn_bit_cmp = 0   !: bit reproducibility  (0/1)
    !                                          
    INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt    !: OLD namelist names
@@ -137,4 +137,5 @@
    !!                          Run control  
    !!----------------------------------------------------------------------
+   INTEGER       ::   no_print = 0          !: optional argument of fld_fill (if present, suppress some control print)
    INTEGER       ::   nstop = 0             !: error flag (=number of reason for a premature stop run)
    INTEGER       ::   nwarn = 0             !: warning flag (=number of warning found during the run)
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 7280)
@@ -4303,4 +4303,5 @@
             WRITE(kout,*)
          ENDIF
+         CALL FLUSH(kout) 
          STOP 'ctl_opn bad opening'
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 7280)
@@ -65,5 +65,5 @@
          WRITE(numout,*)
          WRITE(numout,*) 'mpp_init(2) : NO massively parallel processing'
-         WRITE(numout,*) '~~~~~~~~~~~: '
+         WRITE(numout,*) '~~~~~~~~~~~ '
          WRITE(numout,*) '         nperio = ', nperio
          WRITE(numout,*) '         npolj  = ', npolj
@@ -265,10 +265,7 @@
       
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) ' mpp_init: defines mpp subdomains'
-      IF(lwp) WRITE(numout,*) ' ~~~~~~  ----------------------'
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'iresti=',iresti,' irestj=',irestj
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'jpni=',jpni,' jpnj=',jpnj
+      IF(lwp) WRITE(numout,*) '   defines mpp subdomains'
+      IF(lwp) WRITE(numout,*) '      jpni=', jpni, ' iresti=', iresti
+      IF(lwp) WRITE(numout,*) '      jpnj=', jpnj, ' irestj=', irestj
       zidom = nreci
       DO ji = 1, jpni
@@ -276,5 +273,5 @@
       END DO
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)' sum ilcit(i,1)=', zidom, ' jpiglo=', jpiglo
+      IF(lwp) WRITE(numout,*)'      sum ilcit(i,1)=', zidom, ' jpiglo=', jpiglo
 
       zjdom = nrecj
@@ -282,6 +279,5 @@
          zjdom = zjdom + ilcjt(1,jj) - nrecj
       END DO
-      IF(lwp) WRITE(numout,*)' sum ilcit(1,j)=', zjdom, ' jpjglo=', jpjglo
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*)'      sum ilcit(1,j)=', zjdom, ' jpjglo=', jpjglo
 
       IF(lwp) THEN
@@ -360,20 +356,19 @@
       njmpp  = njmppt(narea)  
 
-     ! Save processor layout in layout.dat file 
-       IF (lwp) THEN
-        CALL ctl_opn( inum, 'layout.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea )
-        WRITE(inum,'(a)') '   jpnij     jpi     jpj     jpk  jpiglo  jpjglo'
-        WRITE(inum,'(6i8)') jpnij,jpi,jpj,jpk,jpiglo,jpjglo
-        WRITE(inum,'(a)') 'NAREA nlci nlcj nldi nldj nlei nlej nimpp njmpp'
-
-        DO  jn = 1, jpnij
-         WRITE(inum,'(9i5)') jn, nlcit(jn), nlcjt(jn), &
-                                      nldit(jn), nldjt(jn), &
-                                      nleit(jn), nlejt(jn), &
-                                      nimppt(jn), njmppt(jn)
-        END DO
-        CLOSE(inum)   
+      ! Save processor layout in layout.dat file 
+      IF(lwp) THEN
+         CALL ctl_opn( inum, 'layout.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea )
+         WRITE(inum,'(a)') '   jpnij     jpi     jpj     jpk  jpiglo  jpjglo'
+         WRITE(inum,'(6i8)') jpnij,jpi,jpj,jpk,jpiglo,jpjglo
+         WRITE(inum,'(a)') 'NAREA nlci nlcj nldi nldj nlei nlej nimpp njmpp'
+         !
+         DO jn = 1, jpnij
+            WRITE(inum,'(9i5)') jn, nlcit(jn), nlcjt(jn), &
+               &                    nldit(jn), nldjt(jn), &
+               &                    nleit(jn), nlejt(jn), &
+               &                    nimppt(jn), njmppt(jn)
+         END DO
+         CLOSE(inum)   
       END IF
-
 
       ! w a r n i n g  narea (zone) /= nproc (processors)!
@@ -428,19 +423,16 @@
 
       IF(lwp) THEN
-         WRITE(numout,*) ' nproc  = ', nproc
-         WRITE(numout,*) ' nowe   = ', nowe  , ' noea   =  ', noea
-         WRITE(numout,*) ' nono   = ', nono  , ' noso   =  ', noso
-         WRITE(numout,*) ' nbondi = ', nbondi
-         WRITE(numout,*) ' nbondj = ', nbondj
-         WRITE(numout,*) ' npolj  = ', npolj
-         WRITE(numout,*) ' nperio = ', nperio
-         WRITE(numout,*) ' nlci   = ', nlci
-         WRITE(numout,*) ' nlcj   = ', nlcj
-         WRITE(numout,*) ' nimpp  = ', nimpp
-         WRITE(numout,*) ' njmpp  = ', njmpp
-         WRITE(numout,*) ' nreci  = ', nreci  , ' npse   = ', npse
-         WRITE(numout,*) ' nrecj  = ', nrecj  , ' npsw   = ', npsw
-         WRITE(numout,*) ' jpreci = ', jpreci , ' npne   = ', npne
-         WRITE(numout,*) ' jprecj = ', jprecj , ' npnw   = ', npnw
+         WRITE(numout,*) '      nproc  = ', nproc
+         WRITE(numout,*) '      nowe   = ', nowe  , '      noea   =  ', noea
+         WRITE(numout,*) '      nono   = ', nono  , '      noso   =  ', noso
+         WRITE(numout,*) '      nbondi = ', nbondi, '      nbondj = ', nbondj
+         WRITE(numout,*) '      npolj  = ', npolj
+         WRITE(numout,*) '      nperio = ', nperio
+         WRITE(numout,*) '      nlci   = ', nlci  , '      nlcj   = ', nlcj
+         WRITE(numout,*) '      nimpp  = ', nimpp , '      njmpp  = ', njmpp
+         WRITE(numout,*) '      nreci  = ', nreci , '      npse   = ', npse
+         WRITE(numout,*) '      nrecj  = ', nrecj , '      npsw   = ', npsw
+         WRITE(numout,*) '      jpreci = ', jpreci, '      npne   = ', npne
+         WRITE(numout,*) '      jprecj = ', jprecj, '      npnw   = ', npnw
          WRITE(numout,*)
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LDF/ldfc1d_c2d.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LDF/ldfc1d_c2d.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/LDF/ldfc1d_c2d.F90	(revision 7280)
@@ -59,4 +59,10 @@
       REAL(wp) ::   zw    , zdep2   !   -      -
       !!----------------------------------------------------------------------
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '   ldf_c1d : set a given profile to eddy diffusivity/viscosity coefficients'
+         WRITE(numout,*) '   ~~~~~~~'
+      ENDIF
 
       ! initialization of the profile
@@ -130,6 +136,7 @@
       !
       IF(lwp) THEN
-         WRITE(numout,*) 'ldf_c2d :     aht = rn_aht0 *  max(e1,e2)/e_equator     (  laplacian) '
-         WRITE(numout,*) '~~~~~~~       or  = rn_bht0 * [max(e1,e2)/e_equator]**3 (bilaplacian)'
+         WRITE(numout,*)
+         WRITE(numout,*) '   ldf_c2d :     aht = rn_aht0 *  max(e1,e2)/e_equator     (  laplacian) '
+         WRITE(numout,*) '   ~~~~~~~       or  = rn_bht0 * [max(e1,e2)/e_equator]**3 (bilaplacian)'
          WRITE(numout,*)
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 7280)
@@ -27,5 +27,5 @@
    PRIVATE
 
-   PUBLIC   wnd_cyc   ! routine called in sbcblk_core.F90 module
+   PUBLIC   wnd_cyc   ! routine called in sbcblk.F90 module
 
    INTEGER , PARAMETER ::   jp_is1  = 1   ! index of presence 1 or absence 0 of a TC record
@@ -102,5 +102,5 @@
          sn_tc = FLD_N( 'tc_track',     6     ,  'tc'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         , ''            )
          !
-         !  Namelist is read in namsbc_core
+         !  Namelist is read in namsbc_blk
          ! set sf structure
          ALLOCATE( sf(1), STAT=ierror )
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 7280)
@@ -4,12 +4,25 @@
    !! Ocean forcing:  read input field for surface boundary condition
    !!=====================================================================
-   !! History :  2.0  !  06-2006  (S. Masson, G. Madec)  Original code
-   !!                 !  05-2008  (S. Alderson)  Modified for Interpolation in memory from input grid to model grid
-   !!                 !  10-2013  (D. Delrosso, P. Oddo)  suppression of land point prior to interpolation
+   !! History :  2.0  !  2006-06  (S. Masson, G. Madec)  Original code
+   !!            3.0  !  2008-05  (S. Alderson)  Modified for Interpolation in memory from input grid to model grid
+   !!            3.4  !  2013-10  (D. Delrosso, P. Oddo)  suppression of land point prior to interpolation
    !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !!   fld_read      : read input fields used for the computation of the
-   !!                   surface boundary condition
+   !!   fld_read      : read input fields used for the computation of the surface boundary condition
+   !!   fld_init      : initialization of field read
+   !!   fld_rec       : determined the record(s) to be read
+   !!   fld_get       : read the data
+   !!   fld_map       : read global data from file and map onto local data using a general mapping (use for open boundaries)
+   !!   fld_rot       : rotate the vector fields onto the local grid direction
+   !!   fld_clopn     : update the data file name and close/open the files
+   !!   fld_fill      : fill the data structure with the associated information read in namelist
+   !!   wgt_list      : manage the weights used for interpolation
+   !!   wgt_print     : print the list of known weights
+   !!   fld_weight    : create a WGT structure and fill in data from file, restructuring as required
+   !!   apply_seaoverland : fill land with ocean values
+   !!   seaoverland   : create shifted matrices for seaoverland application
+   !!   fld_interp    : apply weights to input gridded data to create data on model grid
+   !!   ksec_week     : function returning the first 3 letters of the first day of the weekly file
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and tracers
@@ -274,9 +287,9 @@
             IF( sd(jf)%ln_tint ) THEN              ! temporal interpolation
                IF(lwp .AND. kt - nit000 <= 100 ) THEN 
-                  clfmt = "('fld_read: var ', a, ' kt = ', i8, ' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
+                  clfmt = "('   fld_read: var ', a, ' kt = ', i8, ' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
                      &    "', records b/a: ', i6.4, '/', i6.4, ' (days ', f9.4,'/', f9.4, ')')"
                   WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,   &            
                      & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday
-                  WRITE(numout, *) 'it_offset is : ',it_offset
+                  WRITE(numout, *) '      it_offset is : ',it_offset
                ENDIF
                ! temporal interpolation weights
@@ -286,5 +299,5 @@
             ELSE   ! nothing to do...
                IF(lwp .AND. kt - nit000 <= 100 ) THEN
-                  clfmt = "('fld_read: var ', a, ' kt = ', i8,' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
+                  clfmt = "('   fld_read: var ', a, ' kt = ', i8,' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   &
                      &    "', record: ', i6.4, ' (days ', f9.4, ' <-> ', f9.4, ')')"
                   WRITE(numout, clfmt) TRIM(sd(jf)%clvar), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,    &
@@ -407,5 +420,5 @@
          CALL fld_get( sdjf, map )         ! read before data in after arrays(as we will swap it later)
          !
-         clfmt = "('fld_init : time-interpolation for ', a, ' read previous record = ', i6, ' at time = ', f7.2, ' days')"
+         clfmt = "('   fld_init : time-interpolation for ', a, ' read previous record = ', i6, ' at time = ', f7.2, ' days')"
          IF(lwp) WRITE(numout, clfmt) TRIM(sdjf%clvar), sdjf%nrec_a(1), REAL(sdjf%nrec_a(2),wp)/rday
          !
@@ -791,5 +804,5 @@
       !!                    ***  ROUTINE fld_clopn  ***
       !!
-      !! ** Purpose :   update the file name and open the file
+      !! ** Purpose :   update the file name and close/open the files
       !!----------------------------------------------------------------------
       TYPE(FLD)        , INTENT(inout) ::   sdjf     ! input field related variables
@@ -882,18 +895,20 @@
 
 
-   SUBROUTINE fld_fill( sdf, sdf_n, cdir, cdcaller, cdtitle, cdnam )
+   SUBROUTINE fld_fill( sdf, sdf_n, cdir, cdcaller, cdtitle, cdnam, knoprint )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE fld_fill  ***
       !!
-      !! ** Purpose :   fill sdf with sdf_n and control print
-      !!----------------------------------------------------------------------
-      TYPE(FLD)  , DIMENSION(:), INTENT(inout) ::   sdf        ! structure of input fields (file informations, fields read)
-      TYPE(FLD_N), DIMENSION(:), INTENT(in   ) ::   sdf_n      ! array of namelist information structures
-      CHARACTER(len=*)         , INTENT(in   ) ::   cdir       ! Root directory for location of flx files
-      CHARACTER(len=*)         , INTENT(in   ) ::   cdcaller   ! 
-      CHARACTER(len=*)         , INTENT(in   ) ::   cdtitle    ! 
-      CHARACTER(len=*)         , INTENT(in   ) ::   cdnam      ! 
-      !
-      INTEGER  ::   jf       ! dummy indices
+      !! ** Purpose :   fill the data structure (sdf) with the associated information 
+      !!              read in namelist (sdf_n) and control print
+      !!----------------------------------------------------------------------
+      TYPE(FLD)  , DIMENSION(:)          , INTENT(inout) ::   sdf        ! structure of input fields (file informations, fields read)
+      TYPE(FLD_N), DIMENSION(:)          , INTENT(in   ) ::   sdf_n      ! array of namelist information structures
+      CHARACTER(len=*)                   , INTENT(in   ) ::   cdir       ! Root directory for location of flx files
+      CHARACTER(len=*)                   , INTENT(in   ) ::   cdcaller   ! name of the calling routine
+      CHARACTER(len=*)                   , INTENT(in   ) ::   cdtitle    ! description of the calling routine 
+      CHARACTER(len=*)                   , INTENT(in   ) ::   cdnam      ! name of the namelist from which sdf_n comes
+      INTEGER                  , OPTIONAL, INTENT(in   ) ::   knoprint   ! no calling routine information printed
+      !
+      INTEGER  ::   jf   ! dummy indices
       !!---------------------------------------------------------------------
       !
@@ -922,18 +937,20 @@
       IF(lwp) THEN      ! control print
          WRITE(numout,*)
-         WRITE(numout,*) TRIM( cdcaller )//' : '//TRIM( cdtitle )
-         WRITE(numout,*) (/ ('~', jf = 1, LEN_TRIM( cdcaller ) ) /)
-         WRITE(numout,*) '          '//TRIM( cdnam )//' Namelist'
-         WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
+         IF( .NOT.PRESENT( knoprint) ) THEN
+            WRITE(numout,*) TRIM( cdcaller )//' : '//TRIM( cdtitle )
+            WRITE(numout,*) (/ ('~', jf = 1, LEN_TRIM( cdcaller ) ) /)
+         ENDIF
+         WRITE(numout,*) '   fld_fill : fill data structure with information from namelist '//TRIM( cdnam )
+         WRITE(numout,*) '   ~~~~~~~~'
+         WRITE(numout,*) '      list of files and frequency (>0: in hours ; <0 in months)'
          DO jf = 1, SIZE(sdf)
-            WRITE(numout,*) '               root filename: '  , TRIM( sdf(jf)%clrootname ),   &
-               &                          ' variable name: '  , TRIM( sdf(jf)%clvar      )
-            WRITE(numout,*) '               frequency: '      ,       sdf(jf)%nfreqh      ,   &
-               &                          ' time interp: '    ,       sdf(jf)%ln_tint     ,   &
-               &                          ' climatology: '    ,       sdf(jf)%ln_clim     ,   &
-               &                          ' weights    : '    , TRIM( sdf(jf)%wgtname    ),   &
-               &                          ' pairing    : '    , TRIM( sdf(jf)%vcomp      ),   &
-               &                          ' data type: '      ,       sdf(jf)%cltype      ,   &
-               &                          ' land/sea mask:'   , TRIM( sdf(jf)%lsmname    )
+            WRITE(numout,*) '      root filename: '  , TRIM( sdf(jf)%clrootname ), '   variable name: ', TRIM( sdf(jf)%clvar )
+            WRITE(numout,*) '         frequency: '      ,       sdf(jf)%nfreqh      ,   &
+               &                  '   time interp: '    ,       sdf(jf)%ln_tint     ,   &
+               &                  '   climatology: '    ,       sdf(jf)%ln_clim
+            WRITE(numout,*) '         weights: '        , TRIM( sdf(jf)%wgtname    ),   &
+               &                  '   pairing: '        , TRIM( sdf(jf)%vcomp      ),   &
+               &                  '   data type: '      ,       sdf(jf)%cltype      ,   &
+               &                  '   land/sea mask:'   , TRIM( sdf(jf)%lsmname    )
             call flush(numout)
          END DO
@@ -947,8 +964,7 @@
       !!                    ***  ROUTINE wgt_list  ***
       !!
-      !! ** Purpose :   search array of WGTs and find a weights file
-      !!                entry, or return a new one adding it to the end
-      !!                if it is a new entry, the weights data is read in and
-      !!                restructured (fld_weight)
+      !! ** Purpose :   search array of WGTs and find a weights file entry,
+      !!                or return a new one adding it to the end if new entry.
+      !!                the weights data is read in and restructured (fld_weight)
       !!----------------------------------------------------------------------
       TYPE( FLD ), INTENT(in   ) ::   sd        ! field with name of weights file
@@ -1019,6 +1035,6 @@
       !!                    ***  ROUTINE fld_weight  ***
       !!
-      !! ** Purpose :   create a new WGT structure and fill in data from  
-      !!                file, restructuring as required
+      !! ** Purpose :   create a new WGT structure and fill in data from file,
+      !!              restructuring as required
       !!----------------------------------------------------------------------
       TYPE( FLD ), INTENT(in) ::   sd   ! field with name of weights file
@@ -1163,5 +1179,5 @@
 
    SUBROUTINE apply_seaoverland( clmaskfile, zfieldo, jpi1_lsm, jpi2_lsm, jpj1_lsm,   &
-                          &      jpj2_lsm, itmpi, itmpj, itmpz, rec1_lsm, recn_lsm )
+      &                          jpj2_lsm, itmpi, itmpj, itmpz, rec1_lsm, recn_lsm )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE apply_seaoverland  ***
@@ -1492,11 +1508,10 @@
       !!                    ***  FUNCTION kshift_week *** 
       !!
-      !! ** Purpose :  
-      !!---------------------------------------------------------------------
-      CHARACTER(len=*), INTENT(in)   ::   cdday   !3 first letters of the first day of the weekly file
-      !!
-      INTEGER                        ::   ksec_week  ! output variable
-      INTEGER                        ::   ijul       !temp variable
-      INTEGER                        ::   ishift     !temp variable
+      !! ** Purpose :   return the first 3 letters of the first day of the weekly file
+      !!---------------------------------------------------------------------
+      CHARACTER(len=*), INTENT(in)   ::   cdday   ! first 3 letters of the first day of the weekly file
+      !!
+      INTEGER                        ::   ksec_week      ! output variable
+      INTEGER                        ::   ijul, ishift   ! local integer
       CHARACTER(len=3),DIMENSION(7)  ::   cl_week 
       !!----------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 7280)
@@ -10,4 +10,5 @@
    !!            3.3  ! 2010-10  (J. Chanut, C. Bricaud)  add the surface pressure forcing
    !!            4.0  ! 2012-05  (C. Rousset) add attenuation coef for use in ice model 
+   !!            4.0  ! 2016-06  (L. Brodeau) new unified bulk routine (based on AeroBulk)
    !!----------------------------------------------------------------------
 
@@ -31,8 +32,6 @@
    !                                   !!* namsbc namelist *
    LOGICAL , PUBLIC ::   ln_usr         !: user defined formulation
-   LOGICAL , PUBLIC ::   ln_flx         !: flux         formulation
-   LOGICAL , PUBLIC ::   ln_blk_clio    !: CLIO bulk    formulation
-   LOGICAL , PUBLIC ::   ln_blk_core    !: CORE bulk    formulation
-   LOGICAL , PUBLIC ::   ln_blk_mfs     !: MFS  bulk    formulation
+   LOGICAL , PUBLIC ::   ln_flx         !: flux      formulation
+   LOGICAL , PUBLIC ::   ln_blk         !: bulk formulation
 #if defined key_oasis3
    LOGICAL , PUBLIC ::   lk_oasis = .TRUE.  !: OASIS used
@@ -74,8 +73,6 @@
    INTEGER , PUBLIC, PARAMETER ::   jp_usr     = 1        !: user defined                  formulation
    INTEGER , PUBLIC, PARAMETER ::   jp_flx     = 2        !: flux                          formulation
-   INTEGER , PUBLIC, PARAMETER ::   jp_clio    = 3        !: CLIO bulk                     formulation
-   INTEGER , PUBLIC, PARAMETER ::   jp_core    = 4        !: CORE bulk                     formulation
+   INTEGER , PUBLIC, PARAMETER ::   jp_blk     = 4        !: bulk                          formulation
    INTEGER , PUBLIC, PARAMETER ::   jp_purecpl = 5        !: Pure ocean-atmosphere Coupled formulation
-   INTEGER , PUBLIC, PARAMETER ::   jp_mfs     = 6        !: MFS  bulk                     formulation
    INTEGER , PUBLIC, PARAMETER ::   jp_none    = 7        !: for OPA when doing coupling via SAS module
    
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90	(revision 7280)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk.F90	(revision 7280)
@@ -0,0 +1,907 @@
+MODULE sbcblk
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk  ***
+   !! Ocean forcing:  momentum, heat and freshwater flux formulation
+   !!                         Aerodynamic Bulk Formulas
+   !!                        SUCCESSOR OF "sbcblk_core"
+   !!=====================================================================
+   !! History :  1.0  !  2004-08  (U. Schweckendiek)  Original CORE code
+   !!            2.0  !  2005-04  (L. Brodeau, A.M. Treguier)  improved CORE bulk and its user interface
+   !!            3.0  !  2006-06  (G. Madec)  sbc rewritting
+   !!             -   !  2006-12  (L. Brodeau)  Original code for turb_core
+   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put
+   !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle
+   !!            3.4  !  2011-11  (C. Harris)  Fill arrays required by CICE
+   !!            3.7  !  2014-06  (L. Brodeau)  simplification and optimization of CORE bulk
+   !!            4.0  !  2016-06  (L. Brodeau)  sbcblk_core becomes sbcblk and is not restricted to the CORE algorithm anymore
+   !!                                          ==> based on AeroBulk (http://aerobulk.sourceforge.net/)
+   !!            4.0  !  2016-10  (G. Madec)  introduce a sbc_blk_init routine
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_blk_init  : initialisation of the chosen bulk formulation as ocean surface boundary condition
+   !!   sbc_blk       : bulk formulation as ocean surface boundary condition
+   !!   blk_oce       : computes momentum, heat and freshwater fluxes over ocean
+   !!   blk_ice       : computes momentum, heat and freshwater fluxes over sea ice
+   !!   rho_air       : density of (moist) air (depends on T_air, q_air and SLP
+   !!   cp_air        : specific heat of (moist) air (depends spec. hum. q_air)
+   !!   q_sat         : saturation humidity as a function of SLP and temperature
+   !!   L_vap         : latent heat of vaporization of water as a function of temperature
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE phycst         ! physical constants
+   USE fldread        ! read input fields
+   USE sbc_oce        ! Surface boundary condition: ocean fields
+   USE cyclone        ! Cyclone 10m wind form trac of cyclone centres
+   USE sbcdcy         ! surface boundary condition: diurnal cycle
+   USE sbcwave , ONLY :   cdn_wave ! wave module
+   USE sbc_ice        ! Surface boundary condition: ice fields
+   USE lib_fortran    ! to use key_nosignedzero
+#if defined key_lim3
+   USE ice     , ONLY :   u_ice, v_ice, jpl, pfrld, a_i_b
+   USE limthd_dh      ! for CALL lim_thd_snwblow
+#elif defined key_lim2
+   USE ice_2   , ONLY :   u_ice, v_ice
+   USE par_ice_2      ! LIM-2 parameters
+#endif
+   USE sbcblk_algo_ncar     ! => turb_ncar     : NCAR - CORE (Large & Yeager, 2009) 
+   USE sbcblk_algo_coare    ! => turb_coare    : COAREv3.0 (Fairall et al. 2003) 
+   USE sbcblk_algo_coare3p5 ! => turb_coare3p5 : COAREv3.5 (Edson et al. 2013)
+   USE sbcblk_algo_ecmwf    ! => turb_ecmwf    : ECMWF (IFS cycle 31) 
+   !
+   USE iom            ! I/O manager library
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! distribued memory computing library
+   USE wrk_nemo       ! work arrays
+   USE timing         ! Timing
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE prtctl         ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_blk_init  ! called in sbcmod
+   PUBLIC   sbc_blk       ! called in sbcmod
+#if defined key_lim2 || defined key_lim3
+   PUBLIC   blk_ice_tau   ! routine called in sbc_ice_lim module
+   PUBLIC   blk_ice_flx   ! routine called in sbc_ice_lim module
+#endif
+
+!!Lolo: should ultimately be moved in the module with all physical constants ?
+!!gm  : In principle, yes.
+   REAL(wp), PARAMETER ::   Cp_dry = 1005.0       !: Specic heat of dry air, constant pressure      [J/K/kg]
+   REAL(wp), PARAMETER ::   Cp_vap = 1860.0       !: Specic heat of water vapor, constant pressure  [J/K/kg]
+   REAL(wp), PARAMETER ::   R_dry = 287.05_wp     !: Specific gas constant for dry air              [J/K/kg]
+   REAL(wp), PARAMETER ::   R_vap = 461.495_wp    !: Specific gas constant for water vapor          [J/K/kg]
+   REAL(wp), PARAMETER ::   reps0 = R_dry/R_vap   !: ratio of gas constant for dry air and water vapor => ~ 0.622
+   REAL(wp), PARAMETER ::   rctv0 = R_vap/R_dry   !: for virtual temperature (== (1-eps)/eps) => ~ 0.608
+
+   INTEGER , PARAMETER ::   jpfld   =10           ! maximum number of files to read
+   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
+   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point
+   INTEGER , PARAMETER ::   jp_tair = 3           ! index of 10m air temperature             (Kelvin)
+   INTEGER , PARAMETER ::   jp_humi = 4           ! index of specific humidity               ( % )
+   INTEGER , PARAMETER ::   jp_qsr  = 5           ! index of solar heat                      (W/m2)
+   INTEGER , PARAMETER ::   jp_qlw  = 6           ! index of Long wave                       (W/m2)
+   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
+   INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
+   INTEGER , PARAMETER ::   jp_slp  = 9           ! index of snow (solid prcipitation)       (kg/m2/s)
+   INTEGER , PARAMETER ::   jp_tdif =10           ! index of tau diff associated to HF tau   (N/m2)   at T-point
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
+
+   !                                             !!! Bulk parameters
+   REAL(wp), PARAMETER ::   cpa  = 1000.5         ! specific heat of air (only used for ice fluxes now...)
+   REAL(wp), PARAMETER ::   Ls   =    2.839e6     ! latent heat of sublimation
+   REAL(wp), PARAMETER ::   Stef =    5.67e-8     ! Stefan Boltzmann constant
+   REAL(wp), PARAMETER ::   Cice =    1.4e-3      ! iovi 1.63e-3     ! transfer coefficient over ice
+   REAL(wp), PARAMETER ::   albo =    0.066       ! ocean albedo assumed to be constant
+   !
+   !                           !!* Namelist namsbc_blk : bulk parameters
+   LOGICAL  ::   ln_NCAR        ! "NCAR"      algorithm   (Large and Yeager 2008)
+   LOGICAL  ::   ln_COARE_3p0   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   LOGICAL  ::   ln_COARE_3p5   ! "COARE 3.5" algorithm   (Edson et al. 2013)
+   LOGICAL  ::   ln_ECMWF       ! "ECMWF"     algorithm   (IFS cycle 31)
+   !
+   LOGICAL  ::   ln_taudif      ! logical flag to use the "mean of stress module - module of mean stress" data
+   REAL(wp) ::   rn_pfac        ! multiplication factor for precipitation
+   REAL(wp) ::   rn_efac        ! multiplication factor for evaporation (clem)
+   REAL(wp) ::   rn_vfac        ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem)
+   REAL(wp) ::   rn_zqt         ! z(q,t) : height of humidity and temperature measurements
+   REAL(wp) ::   rn_zu          ! z(u)   : height of wind measurements
+
+   INTEGER  ::   nblk           ! choice of the bulk algorithm
+   !                            ! associated indices:
+   INTEGER, PARAMETER ::   np_NCAR      = 1   ! "NCAR" algorithm        (Large and Yeager 2008)
+   INTEGER, PARAMETER ::   np_COARE_3p0 = 2   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
+   INTEGER, PARAMETER ::   np_COARE_3p5 = 3   ! "COARE 3.5" algorithm   (Edson et al. 2013)
+   INTEGER, PARAMETER ::   np_ECMWF     = 4   ! "ECMWF" algorithm       (IFS cycle 31)
+
+   !! * Substitutions
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.7 , NEMO-consortium (2014)
+   !! $Id: sbcblk.F90 6416 2016-04-01 12:22:17Z clem $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE sbc_blk_init
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_blk_init  ***
+      !!
+      !! ** Purpose :   choose and initialize a bulk formulae formulation
+      !!
+      !! ** Method  : 
+      !!
+      !!      C A U T I O N : never mask the surface stress fields
+      !!                      the stress is assumed to be in the (i,j) mesh referential
+      !!
+      !! ** Action  :   
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ifpr, jfld            ! dummy loop indice and argument
+      INTEGER  ::   ios, ierror, ioptio   ! Local integer
+      !!
+      CHARACTER(len=100)            ::   cn_dir                ! Root directory for location of atmospheric forcing files
+      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                 ! array of namelist informations on the fields to read
+      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr       ! informations about the fields to be read
+      TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !       "                        "
+      TYPE(FLD_N) ::   sn_slp , sn_tdif                        !       "                        "
+      NAMELIST/namsbc_blk/ sn_wndi, sn_wndj, sn_humi, sn_qsr, sn_qlw ,                &   ! input fields
+         &                 sn_tair, sn_prec, sn_snow, sn_slp, sn_tdif,                &
+         &                 ln_NCAR, ln_COARE_3p0, ln_COARE_3p5, ln_ECMWF,             &   ! bulk algorithm
+         &                 cn_dir , ln_taudif, rn_zqt, rn_zu, rn_pfac, rn_efac, rn_vfac
+      !!---------------------------------------------------------------------
+      !
+      !                             !** read bulk namelist  
+      REWIND( numnam_ref )                !* Namelist namsbc_blk in reference namelist : bulk parameters
+      READ  ( numnam_ref, namsbc_blk, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_blk in reference namelist', lwp )
+      !
+      REWIND( numnam_cfg )                !* Namelist namsbc_blk in configuration namelist : bulk parameters
+      READ  ( numnam_cfg, namsbc_blk, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_blk in configuration namelist', lwp )
+      !
+      IF(lwm) WRITE( numond, namsbc_blk )
+      !
+      !                             !** initialization of the chosen bulk formulae (+ check)
+      !                                   !* select the bulk chosen in the namelist and check the choice
+      ;                                                        ioptio = 0
+      IF( ln_NCAR      ) THEN   ;   nblk =  np_NCAR        ;   ioptio = ioptio + 1   ;   ENDIF
+      IF( ln_COARE_3p0 ) THEN   ;   nblk =  np_COARE_3p0   ;   ioptio = ioptio + 1   ;   ENDIF
+      IF( ln_COARE_3p5 ) THEN   ;   nblk =  np_COARE_3p5   ;   ioptio = ioptio + 1   ;   ENDIF
+      IF( ln_ECMWF     ) THEN   ;   nblk =  np_ECMWF       ;   ioptio = ioptio + 1   ;   ENDIF
+      !
+      IF( ioptio /= 1 )   CALL ctl_stop( 'sbc_blk_init: Choose one and only one bulk algorithm' )
+      !
+      IF( ln_dm2dc ) THEN                 !* check: diurnal cycle on Qsr
+         IF( sn_qsr%nfreqh /= 24 )   CALL ctl_stop( 'sbc_blk_init: ln_dm2dc=T only with daily short-wave input' )
+         IF( sn_qsr%ln_tint ) THEN 
+            CALL ctl_warn( 'sbc_blk_init: ln_dm2dc=T daily qsr time interpolation done by sbcdcy module',   &
+               &           '              ==> We force time interpolation = .false. for qsr' )
+            sn_qsr%ln_tint = .false.
+         ENDIF
+      ENDIF
+      !                                   !* set the bulk structure
+      !                                      !- store namelist information in an array
+      slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj
+      slf_i(jp_qsr ) = sn_qsr    ;   slf_i(jp_qlw ) = sn_qlw
+      slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi
+      slf_i(jp_prec) = sn_prec   ;   slf_i(jp_snow) = sn_snow
+      slf_i(jp_slp)  = sn_slp    ;   slf_i(jp_tdif) = sn_tdif
+      !
+      lhftau = ln_taudif                     !- add an extra field if HF stress is used
+      jfld = jpfld - COUNT( (/.NOT.lhftau/) )
+      !
+      !                                      !- allocate the bulk structure
+      ALLOCATE( sf(jfld), STAT=ierror )
+      IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_init: unable to allocate sf structure' )
+      DO ifpr= 1, jfld
+         ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
+         IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
+      END DO
+      !                                      !- fill the bulk structure with namelist informations
+      CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_init', 'surface boundary condition -- bulk formulae', 'namsbc_blk' )
+      !
+      !           
+      IF(lwp) THEN                     !** Control print
+         !
+         WRITE(numout,*)                  !* namelist 
+         WRITE(numout,*) '   Namelist namsbc_blk (other than data information):'
+         WRITE(numout,*) '      "NCAR"      algorithm   (Large and Yeager 2008)     ln_NCAR      = ', ln_NCAR
+         WRITE(numout,*) '      "COARE 3.0" algorithm   (Fairall et al. 2003)       ln_COARE_3p0 = ', ln_COARE_3p0
+         WRITE(numout,*) '      "COARE 3.5" algorithm   (Edson et al. 2013)         ln_COARE_3p5 = ', ln_COARE_3p0
+         WRITE(numout,*) '      "ECMWF"     algorithm   (IFS cycle 31)              ln_ECMWF     = ', ln_ECMWF
+         WRITE(numout,*) '      add High freq.contribution to the stress module     ln_taudif    = ', ln_taudif
+         WRITE(numout,*) '      Air temperature and humidity reference height (m)   rn_zqt       = ', rn_zqt
+         WRITE(numout,*) '      Wind vector reference height (m)                    rn_zu        = ', rn_zu
+         WRITE(numout,*) '      factor applied on precipitation (total & snow)      rn_pfac      = ', rn_pfac
+         WRITE(numout,*) '      factor applied on evaporation                       rn_efac      = ', rn_efac
+         WRITE(numout,*) '      factor applied on ocean/ice velocity                rn_vfac      = ', rn_vfac
+         WRITE(numout,*) '         (form absolute (=0) to relative winds(=1))'
+         !
+         WRITE(numout,*)
+         SELECT CASE( nblk )              !* Print the choice of bulk algorithm
+         CASE( np_NCAR      )   ;   WRITE(numout,*) '      ===>>   "NCAR" algorithm        (Large and Yeager 2008)'
+         CASE( np_COARE_3p0 )   ;   WRITE(numout,*) '      ===>>   "COARE 3.0" algorithm   (Fairall et al. 2003)'
+         CASE( np_COARE_3p5 )   ;   WRITE(numout,*) '      ===>>   "COARE 3.5" algorithm   (Edson et al. 2013)'
+         CASE( np_ECMWF     )   ;   WRITE(numout,*) '      ===>>   "ECMWF" algorithm       (IFS cycle 31)'
+         END SELECT
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_blk_init
+
+
+   SUBROUTINE sbc_blk( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_blk  ***
+      !!
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!      (momentum, heat, freshwater and runoff)
+      !!
+      !! ** Method  : (1) READ each fluxes in NetCDF files:
+      !!      the 10m wind velocity (i-component) (m/s)    at T-point
+      !!      the 10m wind velocity (j-component) (m/s)    at T-point
+      !!      the 10m or 2m specific humidity     ( % )
+      !!      the solar heat                      (W/m2)
+      !!      the Long wave                       (W/m2)
+      !!      the 10m or 2m air temperature       (Kelvin)
+      !!      the total precipitation (rain+snow) (Kg/m2/s)
+      !!      the snow (solid prcipitation)       (kg/m2/s)
+      !!      the tau diff associated to HF tau   (N/m2)   at T-point   (ln_taudif=T)
+      !!              (2) CALL blk_oce
+      !!
+      !!      C A U T I O N : never mask the surface stress fields
+      !!                      the stress is assumed to be in the (i,j) mesh referential
+      !!
+      !! ** Action  :   defined at each time-step at the air-sea interface
+      !!              - utau, vtau  i- and j-component of the wind stress
+      !!              - taum        wind stress module at T-point
+      !!              - wndm        wind speed  module at T-point over free ocean or leads in presence of sea-ice
+      !!              - qns, qsr    non-solar and solar heat fluxes
+      !!              - emp         upward mass flux (evapo. - precip.)
+      !!              - sfx         salt flux due to freezing/melting (non-zero only if ice is present)
+      !!                            (set in limsbc(_2).F90)
+      !!
+      !! ** References :   Large & Yeager, 2004 / Large & Yeager, 2008
+      !!                   Brodeau et al. Ocean Modelling 2010
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !!---------------------------------------------------------------------
+      !
+      CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step
+      !
+      !                                            ! compute the surface ocean fluxes using bulk formulea
+      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce( kt, sf, sst_m, ssu_m, ssv_m )
+
+#if defined key_cice
+      IF( MOD( kt - 1, nn_fsbc ) == 0 )   THEN
+         qlw_ice(:,:,1)   = sf(jp_qlw )%fnow(:,:,1)
+         qsr_ice(:,:,1)   = sf(jp_qsr )%fnow(:,:,1)
+         tatm_ice(:,:)    = sf(jp_tair)%fnow(:,:,1)
+         qatm_ice(:,:)    = sf(jp_humi)%fnow(:,:,1)
+         tprecip(:,:)     = sf(jp_prec)%fnow(:,:,1) * rn_pfac
+         sprecip(:,:)     = sf(jp_snow)%fnow(:,:,1) * rn_pfac
+         wndi_ice(:,:)    = sf(jp_wndi)%fnow(:,:,1)
+         wndj_ice(:,:)    = sf(jp_wndj)%fnow(:,:,1)
+      ENDIF
+#endif
+      !
+   END SUBROUTINE sbc_blk
+
+
+   SUBROUTINE blk_oce( kt, sf, pst, pu, pv )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE blk_oce  ***
+      !!
+      !! ** Purpose :   provide the momentum, heat and freshwater fluxes at
+      !!      the ocean surface at each time step
+      !!
+      !! ** Method  :   bulk formulea for the ocean using atmospheric
+      !!      fields read in sbc_read
+      !!
+      !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2)
+      !!              - vtau    : j-component of the stress at V-point  (N/m2)
+      !!              - taum    : Wind stress module at T-point         (N/m2)
+      !!              - wndm    : Wind speed module at T-point          (m/s)
+      !!              - qsr     : Solar heat flux over the ocean        (W/m2)
+      !!              - qns     : Non Solar heat flux over the ocean    (W/m2)
+      !!              - emp     : evaporation minus precipitation       (kg/m2/s)
+      !!
+      !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC
+      !!---------------------------------------------------------------------
+      INTEGER  , INTENT(in   )                 ::   kt    ! time step index
+      TYPE(fld), INTENT(inout), DIMENSION(:)   ::   sf    ! input data
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pst   ! surface temperature                      [Celcius]
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s]
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s]
+      !
+      INTEGER  ::   ji, jj               ! dummy loop indices
+      REAL(wp) ::   zztmp                ! local variable
+      REAL(wp), DIMENSION(:,:), POINTER ::   zwnd_i, zwnd_j    ! wind speed components at T-point
+      REAL(wp), DIMENSION(:,:), POINTER ::   zsq               ! specific humidity at pst
+      REAL(wp), DIMENSION(:,:), POINTER ::   zqlw, zqsb        ! long wave and sensible heat fluxes
+      REAL(wp), DIMENSION(:,:), POINTER ::   zqla, zevap       ! latent heat fluxes and evaporation
+      REAL(wp), DIMENSION(:,:), POINTER ::   Cd                ! transfer coefficient for momentum      (tau)
+      REAL(wp), DIMENSION(:,:), POINTER ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), DIMENSION(:,:), POINTER ::   Ce                ! tansfert coefficient for evaporation   (Q_lat)
+      REAL(wp), DIMENSION(:,:), POINTER ::   zst               ! surface temperature in Kelvin
+      REAL(wp), DIMENSION(:,:), POINTER ::   zt_zu             ! air temperature at wind speed height
+      REAL(wp), DIMENSION(:,:), POINTER ::   zq_zu             ! air spec. hum.  at wind speed height
+      REAL(wp), DIMENSION(:,:), POINTER ::   zU_zu             ! bulk wind speed at height zu  [m/s]
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztpot             ! potential temperature of air at z=rn_zqt [K]
+      REAL(wp), DIMENSION(:,:), POINTER ::   zrhoa             ! density of air   [kg/m^3]
+      !!---------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('blk_oce')
+      !
+      CALL wrk_alloc( jpi,jpj,   zwnd_i, zwnd_j, zsq, zqlw, zqsb, zqla, zevap )
+      CALL wrk_alloc( jpi,jpj,   Cd, Ch, Ce, zst, zt_zu, zq_zu )
+      CALL wrk_alloc( jpi,jpj,   zU_zu, ztpot, zrhoa )
+      !
+
+      ! local scalars ( place there for vector optimisation purposes)
+      zst(:,:) = pst(:,:) + rt0      ! convert SST from Celcius to Kelvin (and set minimum value far above 0 K)
+
+      ! ----------------------------------------------------------------------------- !
+      !      0   Wind components and module at T-point relative to the moving ocean   !
+      ! ----------------------------------------------------------------------------- !
+
+      ! ... components ( U10m - U_oce ) at T-point (unmasked)
+!!gm    move zwnd_i (_j) set to zero  inside the key_cyclone ???
+      zwnd_i(:,:) = 0._wp
+      zwnd_j(:,:) = 0._wp
+#if defined key_cyclone
+      CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012)
+      DO jj = 2, jpjm1
+         DO ji = fs_2, fs_jpim1   ! vect. opt.
+            sf(jp_wndi)%fnow(ji,jj,1) = sf(jp_wndi)%fnow(ji,jj,1) + zwnd_i(ji,jj)
+            sf(jp_wndj)%fnow(ji,jj,1) = sf(jp_wndj)%fnow(ji,jj,1) + zwnd_j(ji,jj)
+         END DO
+      END DO
+#endif
+      DO jj = 2, jpjm1
+         DO ji = fs_2, fs_jpim1   ! vect. opt.
+            zwnd_i(ji,jj) = (  sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  )
+            zwnd_j(ji,jj) = (  sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  )
+         END DO
+      END DO
+      CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. )
+      CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. )
+      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
+      wndm(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   &
+         &             + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1)
+
+      ! ----------------------------------------------------------------------------- !
+      !      I   Radiative FLUXES                                                     !
+      ! ----------------------------------------------------------------------------- !
+
+      ! ocean albedo assumed to be constant + modify now Qsr to include the diurnal cycle                    ! Short Wave
+      zztmp = 1. - albo
+      IF( ln_dm2dc ) THEN   ;   qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1)
+      ELSE                  ;   qsr(:,:) = zztmp *          sf(jp_qsr)%fnow(:,:,1)   * tmask(:,:,1)
+      ENDIF
+
+      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
+
+
+
+      ! ----------------------------------------------------------------------------- !
+      !     II    Turbulent FLUXES                                                    !
+      ! ----------------------------------------------------------------------------- !
+
+      ! ... specific humidity at SST and IST tmask(
+      zsq(:,:) = 0.98 * q_sat( zst(:,:), sf(jp_slp)%fnow(:,:,1) )
+      !!
+      !! Estimate of potential temperature at z=rn_zqt, based on adiabatic lapse-rate
+      !!    (see Josey, Gulev & Yu, 2013) / doi=10.1016/B978-0-12-391851-2.00005-2
+      !!    (since reanalysis products provide T at z, not theta !)
+      ztpot = sf(jp_tair)%fnow(:,:,1) + gamma_moist( sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1) ) * rn_zqt
+
+      SELECT CASE( nblk )        !==  transfer coefficients  ==!   Cd, Ch, Ce at T-point
+      !
+      CASE( np_NCAR      )   ;   CALL turb_ncar    ( rn_zqt, rn_zu, zst, ztpot, zsq, sf(jp_humi)%fnow, wndm,   &  ! NCAR-COREv2
+         &                                               Cd, Ch, Ce, zt_zu, zq_zu, zU_zu )
+      CASE( np_COARE_3p0 )   ;   CALL turb_coare   ( rn_zqt, rn_zu, zst, ztpot, zsq, sf(jp_humi)%fnow, wndm,   &  ! COARE v3.0
+         &                                               Cd, Ch, Ce, zt_zu, zq_zu, zU_zu )
+      CASE( np_COARE_3p5 )   ;   CALL turb_coare3p5( rn_zqt, rn_zu, zst, ztpot, zsq, sf(jp_humi)%fnow, wndm,   &  ! COARE v3.5
+         &                                               Cd, Ch, Ce, zt_zu, zq_zu, zU_zu )
+      CASE( np_ECMWF     )   ;   CALL turb_ecmwf   ( rn_zqt, rn_zu, zst, ztpot, zsq, sf(jp_humi)%fnow, wndm,   &  ! ECMWF
+         &                                               Cd, Ch, Ce, zt_zu, zq_zu, zU_zu )
+      CASE DEFAULT
+         CALL ctl_stop( 'STOP', 'sbc_oce: non-existing bulk formula selected' )
+      END SELECT
+
+      !                          ! Compute true air density :
+      IF( ABS(rn_zu - rn_zqt) > 0.01 ) THEN     ! At zu: (probably useless to remove zrho*grav*rn_zu from SLP...)
+         zrhoa(:,:) = rho_air( zt_zu(:,:)             , zq_zu(:,:)             , sf(jp_slp)%fnow(:,:,1) )
+      ELSE                                      ! At zt:
+         zrhoa(:,:) = rho_air( sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1) )
+      END IF
+
+      DO jj = 1, jpj             ! tau module, i and j component
+         DO ji = 1, jpi
+            zztmp = zrhoa(ji,jj)  * zU_zu(ji,jj) * Cd(ji,jj)   ! using bulk wind speed
+            taum  (ji,jj) = zztmp * wndm  (ji,jj)
+            zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj)
+            zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj)
+         END DO
+      END DO
+
+      !                          ! add the HF tau contribution to the wind stress module
+      IF( lhftau )   taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1)
+
+      CALL iom_put( "taum_oce", taum )   ! output wind stress module
+
+      ! ... utau, vtau at U- and V_points, resp.
+      !     Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines
+      !     Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves
+      DO jj = 1, jpjm1
+         DO ji = 1, fs_jpim1
+            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) &
+               &          * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1))
+            vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) &
+               &          * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1))
+         END DO
+      END DO
+      CALL lbc_lnk( utau(:,:), 'U', -1. )
+      CALL lbc_lnk( vtau(:,:), 'V', -1. )
+
+
+      !  Turbulent fluxes over ocean
+      ! -----------------------------
+
+      ! zqla used as temporary array, for rho*U (common term of bulk formulae):
+      zqla(:,:) = zrhoa(:,:) * zU_zu(:,:)
+
+      IF( ABS( rn_zu - rn_zqt) < 0.01_wp ) THEN
+         !! q_air and t_air are given at 10m (wind reference height)
+         zevap(:,:) = rn_efac*MAX( 0._wp,             zqla(:,:)*Ce(:,:)*(zsq(:,:) - sf(jp_humi)%fnow(:,:,1)) ) ! Evaporation, using bulk wind speed
+         zqsb (:,:) = cp_air(sf(jp_humi)%fnow(:,:,1))*zqla(:,:)*Ch(:,:)*(zst(:,:) - ztpot(:,:)             )   ! Sensible Heat, using bulk wind speed
+      ELSE
+         !! q_air and t_air are not given at 10m (wind reference height)
+         ! Values of temp. and hum. adjusted to height of wind during bulk algorithm iteration must be used!!!
+         zevap(:,:) = rn_efac*MAX( 0._wp,             zqla(:,:)*Ce(:,:)*(zsq(:,:) - zq_zu(:,:) ) ) ! Evaporation ! using bulk wind speed
+         zqsb (:,:) = cp_air(sf(jp_humi)%fnow(:,:,1))*zqla(:,:)*Ch(:,:)*(zst(:,:) - zt_zu(:,:) )   ! Sensible Heat ! using bulk wind speed
+      ENDIF
+
+      zqla(:,:) = L_vap(zst(:,:)) * zevap(:,:)     ! Latent Heat flux
+
+
+      IF(ln_ctl) THEN
+         CALL prt_ctl( tab2d_1=zqla  , clinfo1=' blk_oce: zqla   : ', tab2d_2=Ce , clinfo2=' Ce  : ' )
+         CALL prt_ctl( tab2d_1=zqsb  , clinfo1=' blk_oce: zqsb   : ', tab2d_2=Ch , clinfo2=' Ch  : ' )
+         CALL prt_ctl( tab2d_1=zqlw  , clinfo1=' blk_oce: zqlw   : ', tab2d_2=qsr, clinfo2=' qsr : ' )
+         CALL prt_ctl( tab2d_1=zsq   , clinfo1=' blk_oce: zsq    : ', tab2d_2=zst, clinfo2=' zst : ' )
+         CALL prt_ctl( tab2d_1=utau  , clinfo1=' blk_oce: utau   : ', mask1=umask,   &
+            &          tab2d_2=vtau  , clinfo2=           ' vtau : ', mask2=vmask )
+         CALL prt_ctl( tab2d_1=wndm  , clinfo1=' blk_oce: wndm   : ')
+         CALL prt_ctl( tab2d_1=zst   , clinfo1=' blk_oce: zst    : ')
+      ENDIF
+
+      ! ----------------------------------------------------------------------------- !
+      !     III    Total FLUXES                                                       !
+      ! ----------------------------------------------------------------------------- !
+      !
+      emp (:,:) = (  zevap(:,:)                                          &   ! mass flux (evap. - precip.)
+         &         - sf(jp_prec)%fnow(:,:,1) * rn_pfac  ) * tmask(:,:,1)
+      !
+      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                &   ! Downward Non Solar
+         &     - sf(jp_snow)%fnow(:,:,1) * rn_pfac * lfus                         &   ! remove latent melting heat for solid precip
+         &     - zevap(:,:) * pst(:,:) * rcp                                      &   ! remove evap heat content at SST
+         &     + ( sf(jp_prec)%fnow(:,:,1) - sf(jp_snow)%fnow(:,:,1) ) * rn_pfac  &   ! add liquid precip heat content at Tair
+         &     * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp                          &
+         &     + sf(jp_snow)%fnow(:,:,1) * rn_pfac                                &   ! add solid  precip heat content at min(Tair,Tsnow)
+         &     * ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1)
+      !
+#if defined key_lim3
+      qns_oce(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                ! non solar without emp (only needed by LIM3)
+      qsr_oce(:,:) = qsr(:,:)
+#endif
+      !
+      IF ( nn_ice == 0 ) THEN
+         CALL iom_put( "qlw_oce" ,   zqlw )                 ! output downward longwave heat over the ocean
+         CALL iom_put( "qsb_oce" , - zqsb )                 ! output downward sensible heat over the ocean
+         CALL iom_put( "qla_oce" , - zqla )                 ! output downward latent   heat over the ocean
+         CALL iom_put( "qemp_oce",   qns-zqlw+zqsb+zqla )   ! output downward heat content of E-P over the ocean
+         CALL iom_put( "qns_oce" ,   qns  )                 ! output downward non solar heat over the ocean
+         CALL iom_put( "qsr_oce" ,   qsr  )                 ! output downward solar heat over the ocean
+         CALL iom_put( "qt_oce"  ,   qns+qsr )              ! output total downward heat over the ocean
+         tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac   ! output total precipitation [kg/m2/s]
+         sprecip(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac   ! output solid precipitation [kg/m2/s]
+         CALL iom_put( 'snowpre', sprecip * 86400. )        ! Snow
+         CALL iom_put( 'precip' , tprecip * 86400. )        ! Total precipitation
+      ENDIF
+      !
+      IF(ln_ctl) THEN
+         CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce: zqsb   : ', tab2d_2=zqlw , clinfo2=' zqlw  : ')
+         CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce: zqla   : ', tab2d_2=qsr  , clinfo2=' qsr   : ')
+         CALL prt_ctl(tab2d_1=pst  , clinfo1=' blk_oce: pst    : ', tab2d_2=emp  , clinfo2=' emp   : ')
+         CALL prt_ctl(tab2d_1=utau , clinfo1=' blk_oce: utau   : ', mask1=umask,   &
+            &         tab2d_2=vtau , clinfo2=              ' vtau  : ' , mask2=vmask )
+      ENDIF
+      !
+      CALL wrk_dealloc( jpi,jpj,   zwnd_i, zwnd_j, zsq, zqlw, zqsb, zqla, zevap )
+      CALL wrk_dealloc( jpi,jpj,   Cd, Ch, Ce, zst, zt_zu, zq_zu )
+      CALL wrk_dealloc( jpi,jpj,   zU_zu, ztpot, zrhoa )
+      !
+      IF( nn_timing == 1 )  CALL timing_stop('blk_oce')
+      !
+   END SUBROUTINE blk_oce
+
+#if defined key_lim2 || defined key_lim3
+
+   SUBROUTINE blk_ice_tau
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE blk_ice_tau  ***
+      !!
+      !! ** Purpose :   provide the surface boundary condition over sea-ice
+      !!
+      !! ** Method  :   compute momentum using bulk formulation
+      !!                formulea, ice variables and read atmospheric fields.
+      !!                NB: ice drag coefficient is assumed to be a constant
+      !!---------------------------------------------------------------------
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      !
+      REAL(wp), DIMENSION(:,:)  , POINTER :: zcoef_wnorm
+      !
+      REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f               ! relative wind module and components at F-point
+      REAL(wp) ::             zwndi_t , zwndj_t               ! relative wind components at T-point
+      !!---------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('blk_ice_tau')
+      !
+      CALL wrk_alloc( jpi,jpj,   zcoef_wnorm )
+
+      ! local scalars ( place there for vector optimisation purposes)
+      ! Computing density of air! Way denser that 1.2 over sea-ice !!!
+      !!
+      zcoef_wnorm (:,:) =  rho_air(sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1))
+      zcoef_wnorm (:,:) =  Cice * zcoef_wnorm (:,:)
+
+      !!gm brutal....
+      utau_ice  (:,:) = 0._wp
+      vtau_ice  (:,:) = 0._wp
+      wndm_ice  (:,:) = 0._wp
+      !!gm end
+
+      ! ----------------------------------------------------------------------------- !
+      !    Wind components and module relative to the moving ocean ( U10m - U_ice )   !
+      ! ----------------------------------------------------------------------------- !
+      SELECT CASE( cp_ice_msh )
+      CASE( 'I' )                  ! B-grid ice dynamics :   I-point (i.e. F-point with sea-ice indexation)
+         !                           and scalar wind at T-point ( = | U10m - U_ice | ) (masked)
+         DO jj = 2, jpjm1
+            DO ji = 2, jpim1   ! B grid : NO vector opt
+               ! ... scalar wind at I-point (fld being at T-point)
+               zwndi_f = 0.25 * (  sf(jp_wndi)%fnow(ji-1,jj  ,1) + sf(jp_wndi)%fnow(ji  ,jj  ,1)   &
+                  &              + sf(jp_wndi)%fnow(ji-1,jj-1,1) + sf(jp_wndi)%fnow(ji  ,jj-1,1)  ) - rn_vfac * u_ice(ji,jj)
+               zwndj_f = 0.25 * (  sf(jp_wndj)%fnow(ji-1,jj  ,1) + sf(jp_wndj)%fnow(ji  ,jj  ,1)   &
+                  &              + sf(jp_wndj)%fnow(ji-1,jj-1,1) + sf(jp_wndj)%fnow(ji  ,jj-1,1)  ) - rn_vfac * v_ice(ji,jj)
+               zwnorm_f = zcoef_wnorm(ji,jj) * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f )
+               ! ... ice stress at I-point
+               utau_ice(ji,jj) = zwnorm_f * zwndi_f
+               vtau_ice(ji,jj) = zwnorm_f * zwndj_f
+               ! ... scalar wind at T-point (fld being at T-point)
+               zwndi_t = sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.25 * (  u_ice(ji,jj+1) + u_ice(ji+1,jj+1)   &
+                  &                                                    + u_ice(ji,jj  ) + u_ice(ji+1,jj  )  )
+               zwndj_t = sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.25 * (  v_ice(ji,jj+1) + v_ice(ji+1,jj+1)   &
+                  &                                                    + v_ice(ji,jj  ) + v_ice(ji+1,jj  )  )
+               wndm_ice(ji,jj)  = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
+            END DO
+         END DO
+         CALL lbc_lnk( utau_ice, 'I', -1. )
+         CALL lbc_lnk( vtau_ice, 'I', -1. )
+         CALL lbc_lnk( wndm_ice, 'T',  1. )
+         !
+      CASE( 'C' )                  ! C-grid ice dynamics :   U & V-points (same as ocean)
+         DO jj = 2, jpj
+            DO ji = fs_2, jpi   ! vect. opt.
+               zwndi_t = (  sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( u_ice(ji-1,jj  ) + u_ice(ji,jj) )  )
+               zwndj_t = (  sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( v_ice(ji  ,jj-1) + v_ice(ji,jj) )  )
+               wndm_ice(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
+            END DO
+         END DO
+         DO jj = 2, jpjm1
+            DO ji = fs_2, fs_jpim1   ! vect. opt.
+               utau_ice(ji,jj) = 0.5*zcoef_wnorm(ji,jj) * ( wndm_ice(ji+1,jj  ) + wndm_ice(ji,jj) )                          &
+                  &          * ( 0.5 * (sf(jp_wndi)%fnow(ji+1,jj,1) + sf(jp_wndi)%fnow(ji,jj,1) ) - rn_vfac * u_ice(ji,jj) )
+               vtau_ice(ji,jj) = 0.5*zcoef_wnorm(ji,jj) * ( wndm_ice(ji,jj+1  ) + wndm_ice(ji,jj) )                          &
+                  &          * ( 0.5 * (sf(jp_wndj)%fnow(ji,jj+1,1) + sf(jp_wndj)%fnow(ji,jj,1) ) - rn_vfac * v_ice(ji,jj) )
+            END DO
+         END DO
+         CALL lbc_lnk( utau_ice, 'U', -1. )
+         CALL lbc_lnk( vtau_ice, 'V', -1. )
+         CALL lbc_lnk( wndm_ice, 'T',  1. )
+         !
+      END SELECT
+
+      IF(ln_ctl) THEN
+         CALL prt_ctl(tab2d_1=utau_ice  , clinfo1=' blk_ice: utau_ice : ', tab2d_2=vtau_ice  , clinfo2=' vtau_ice : ')
+         CALL prt_ctl(tab2d_1=wndm_ice  , clinfo1=' blk_ice: wndm_ice : ')
+      ENDIF
+
+      CALL wrk_dealloc( jpi,jpj,   zcoef_wnorm )
+
+      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_tau')
+
+   END SUBROUTINE blk_ice_tau
+
+
+   SUBROUTINE blk_ice_flx( ptsu, palb )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE blk_ice_flx  ***
+      !!
+      !! ** Purpose :   provide the surface boundary condition over sea-ice
+      !!
+      !! ** Method  :   compute heat and freshwater exchanged
+      !!                between atmosphere and sea-ice using bulk formulation
+      !!                formulea, ice variables and read atmmospheric fields.
+      !!
+      !! caution : the net upward water flux has with mm/day unit
+      !!---------------------------------------------------------------------
+      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   ptsu   ! sea ice surface temperature
+      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   palb   ! ice albedo (all skies)
+      !!
+      INTEGER  ::   ji, jj, jl               ! dummy loop indices
+      REAL(wp) ::   zst2, zst3               ! local variable
+      REAL(wp) ::   zcoef_dqlw, zcoef_dqla   !   -      -
+      REAL(wp) ::   zztmp, z1_lsub           !   -      -
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qlw         ! long wave heat flux over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qsb         ! sensible  heat flux over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqlw        ! long wave heat sensitivity over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqsb        ! sensible  heat sensitivity over ice
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   zevap, zsnw   ! evaporation and snw distribution after wind blowing (LIM3)
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   zrhoa
+      !!---------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('blk_ice_flx')
+      !
+      CALL wrk_alloc( jpi,jpj,jpl,   z_qlw, z_qsb, z_dqlw, z_dqsb )
+      CALL wrk_alloc( jpi,jpj,       zrhoa)
+      !
+      ! local scalars ( place there for vector optimisation purposes)
+      zcoef_dqlw   = 4.0 * 0.95 * Stef
+      zcoef_dqla   = -Ls * Cice * 11637800. * (-5897.8)
+      !
+      zrhoa(:,:) = rho_air( sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1) )
+      !
+      zztmp = 1. / ( 1. - albo )
+      !                                     ! ========================== !
+      DO jl = 1, jpl                        !  Loop over ice categories  !
+         !                                  ! ========================== !
+         DO jj = 1 , jpj
+            DO ji = 1, jpi
+               ! ----------------------------!
+               !      I   Radiative FLUXES   !
+               ! ----------------------------!
+               zst2 = ptsu(ji,jj,jl) * ptsu(ji,jj,jl)
+               zst3 = ptsu(ji,jj,jl) * zst2
+               ! Short Wave (sw)
+               qsr_ice(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr(ji,jj)
+               ! Long  Wave (lw)
+               z_qlw(ji,jj,jl) = 0.95 * ( sf(jp_qlw)%fnow(ji,jj,1) - Stef * ptsu(ji,jj,jl) * zst3 ) * tmask(ji,jj,1)
+               ! lw sensitivity
+               z_dqlw(ji,jj,jl) = zcoef_dqlw * zst3
+
+               ! ----------------------------!
+               !     II    Turbulent FLUXES  !
+               ! ----------------------------!
+
+               ! ... turbulent heat fluxes
+               ! Sensible Heat
+               z_qsb(ji,jj,jl) = zrhoa(ji,jj) * cpa * Cice * wndm_ice(ji,jj) * ( ptsu(ji,jj,jl) - sf(jp_tair)%fnow(ji,jj,1) )
+               ! Latent Heat
+               qla_ice(ji,jj,jl) = rn_efac * MAX( 0.e0, zrhoa(ji,jj) * Ls  * Cice * wndm_ice(ji,jj)   &
+                  &                         * (  11637800. * EXP( -5897.8 / ptsu(ji,jj,jl) ) / zrhoa(ji,jj) - sf(jp_humi)%fnow(ji,jj,1)  ) )
+               ! Latent heat sensitivity for ice (Dqla/Dt)
+               IF( qla_ice(ji,jj,jl) > 0._wp ) THEN
+                  dqla_ice(ji,jj,jl) = rn_efac * zcoef_dqla * wndm_ice(ji,jj) / ( zst2 ) * EXP( -5897.8 / ptsu(ji,jj,jl) )
+               ELSE
+                  dqla_ice(ji,jj,jl) = 0._wp
+               ENDIF
+
+               ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice)
+               z_dqsb(ji,jj,jl) = zrhoa(ji,jj)*cpa*Cice * wndm_ice(ji,jj)
+
+               ! ----------------------------!
+               !     III    Total FLUXES     !
+               ! ----------------------------!
+               ! Downward Non Solar flux
+               qns_ice (ji,jj,jl) =     z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - qla_ice (ji,jj,jl)
+               ! Total non solar heat flux sensitivity for ice
+               dqns_ice(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + dqla_ice(ji,jj,jl) )
+            END DO
+            !
+         END DO
+         !
+      END DO
+      !
+      tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac      ! total precipitation [kg/m2/s]
+      sprecip(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac      ! solid precipitation [kg/m2/s]
+      CALL iom_put( 'snowpre', sprecip * 86400. )                  ! Snow precipitation
+      CALL iom_put( 'precip' , tprecip * 86400. )                  ! Total precipitation
+
+#if defined  key_lim3
+      CALL wrk_alloc( jpi,jpj,   zevap, zsnw )
+
+      ! --- evaporation --- !
+      z1_lsub = 1._wp / Lsub
+      evap_ice (:,:,:) = rn_efac * qla_ice (:,:,:) * z1_lsub    ! sublimation
+      devap_ice(:,:,:) = rn_efac * dqla_ice(:,:,:) * z1_lsub    ! d(sublimation)/dT
+      zevap    (:,:)   = rn_efac * ( emp(:,:) + tprecip(:,:) )  ! evaporation over ocean
+
+      ! --- evaporation minus precipitation --- !
+      zsnw(:,:) = 0._wp
+      CALL lim_thd_snwblow( pfrld, zsnw )  ! snow distribution over ice after wind blowing
+      emp_oce(:,:) = pfrld(:,:) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * (1._wp - zsnw )
+      emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw
+      emp_tot(:,:) = emp_oce(:,:) + emp_ice(:,:)
+
+      ! --- heat flux associated with emp --- !
+      qemp_oce(:,:) = - pfrld(:,:) * zevap(:,:) * sst_m(:,:) * rcp                               & ! evap at sst
+         &          + ( tprecip(:,:) - sprecip(:,:) ) * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp  & ! liquid precip at Tair
+         &          +   sprecip(:,:) * ( 1._wp - zsnw ) *                                        & ! solid precip at min(Tair,Tsnow)
+         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
+      qemp_ice(:,:) =   sprecip(:,:) * zsnw *                                                    & ! solid precip (only)
+         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
+
+      ! --- total solar and non solar fluxes --- !
+      qns_tot(:,:) = pfrld(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
+      qsr_tot(:,:) = pfrld(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
+
+      ! --- heat content of precip over ice in J/m3 (to be used in 1D-thermo) --- !
+      qprec_ice(:,:) = rhosn * ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
+
+      CALL wrk_dealloc( jpi,jpj,   zevap, zsnw )
+#endif
+
+      !--------------------------------------------------------------------
+      ! FRACTIONs of net shortwave radiation which is not absorbed in the
+      ! thin surface layer and penetrates inside the ice cover
+      ! ( Maykut and Untersteiner, 1971 ; Ebert and Curry, 1993 )
+      !
+      fr1_i0(:,:) = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice )
+      fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice )
+      !
+      !
+      IF(ln_ctl) THEN
+         CALL prt_ctl(tab3d_1=qla_ice , clinfo1=' blk_ice: qla_ice  : ', tab3d_2=z_qsb   , clinfo2=' z_qsb    : ', kdim=jpl)
+         CALL prt_ctl(tab3d_1=z_qlw   , clinfo1=' blk_ice: z_qlw    : ', tab3d_2=dqla_ice, clinfo2=' dqla_ice : ', kdim=jpl)
+         CALL prt_ctl(tab3d_1=z_dqsb  , clinfo1=' blk_ice: z_dqsb   : ', tab3d_2=z_dqlw  , clinfo2=' z_dqlw   : ', kdim=jpl)
+         CALL prt_ctl(tab3d_1=dqns_ice, clinfo1=' blk_ice: dqns_ice : ', tab3d_2=qsr_ice , clinfo2=' qsr_ice  : ', kdim=jpl)
+         CALL prt_ctl(tab3d_1=ptsu    , clinfo1=' blk_ice: ptsu     : ', tab3d_2=qns_ice , clinfo2=' qns_ice  : ', kdim=jpl)
+         CALL prt_ctl(tab2d_1=tprecip , clinfo1=' blk_ice: tprecip  : ', tab2d_2=sprecip , clinfo2=' sprecip  : ')
+      ENDIF
+
+      CALL wrk_dealloc( jpi,jpj,jpl,   z_qlw, z_qsb, z_dqlw, z_dqsb )
+      CALL wrk_dealloc( jpi,jpj,       zrhoa )
+      !
+      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_flx')
+
+   END SUBROUTINE blk_ice_flx
+   
+#endif
+
+   FUNCTION rho_air( ptak, pqa, pslp )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION rho_air  ***
+      !!
+      !! ** Purpose : compute density of (moist) air using the eq. of state of the atmosphere
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) 
+      !!-------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak      ! air temperature             [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa       ! air specific humidity   [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pslp      ! pressure in                [Pa]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   rho_air   ! density of moist air   [kg/m^3]
+      !!-------------------------------------------------------------------------------
+      !
+      rho_air = pslp / (  R_dry*ptak * ( 1._wp + rctv0*pqa )  )
+      !
+   END FUNCTION rho_air
+
+
+   FUNCTION cp_air( pqa )
+      !!-------------------------------------------------------------------------------
+      !!                           ***  FUNCTION cp_air  ***
+      !!
+      !! ** Purpose : Compute specific heat (Cp) of moist air
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!-------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa      ! air specific humidity         [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   cp_air   ! specific heat of moist air   [J/K/kg]
+      !!-------------------------------------------------------------------------------
+      !
+      Cp_air = Cp_dry + Cp_vap * pqa
+      !
+   END FUNCTION cp_air
+
+
+   FUNCTION q_sat( ptak, pslp )
+      !!----------------------------------------------------------------------------------
+      !!                           ***  FUNCTION q_sat  ***
+      !!
+      !! ** Purpose : Specific humidity at saturation in [kg/kg]
+      !!              Based on accurate estimate of "e_sat"
+      !!              aka saturation water vapor (Goff, 1957)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak    ! air temperature                       [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pslp    ! sea level atmospheric pressure       [Pa]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   q_sat   ! Specific humidity at saturation   [kg/kg]
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::   ze_sat, ztmp   ! local scalar
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            ztmp = rt0 / ptak(ji,jj)
+            !
+            ! Vapour pressure at saturation [hPa] : WMO, (Goff, 1957)
+            ze_sat = 10.**( 10.79574*(1. - ztmp) - 5.028*LOG10(ptak(ji,jj)/rt0)        &
+               &    + 1.50475*10.**(-4)*(1. - 10.**(-8.2969*(ptak(ji,jj)/rt0 - 1.)) )  &
+               &    + 0.42873*10.**(-3)*(10.**(4.76955*(1. - ztmp)) - 1.) + 0.78614  )
+               !
+            q_sat(ji,jj) = reps0 * ze_sat/( 0.01_wp*pslp(ji,jj) - (1._wp - reps0)*ze_sat )   ! 0.01 because SLP is in [Pa]
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION q_sat
+
+
+   FUNCTION gamma_moist( ptak, pqa )
+      !!----------------------------------------------------------------------------------
+      !!                           ***  FUNCTION gamma_moist  ***
+      !!
+      !! ** Purpose : Compute the moist adiabatic lapse-rate.
+      !!     => http://glossary.ametsoc.org/wiki/Moist-adiabatic_lapse_rate
+      !!     => http://www.geog.ucsb.edu/~joel/g266_s10/lecture_notes/chapt03/oh10_3_01/oh10_3_01.html
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak          ! air temperature       [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqa           ! specific humidity [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   gamma_moist   ! moist adiabatic lapse-rate
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) :: zrv, ziRT        ! local scalar
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zrv = pqa(ji,jj) / (1. - pqa(ji,jj))
+            ziRT = 1. / (R_dry*ptak(ji,jj))    ! 1/RT
+            gamma_moist(ji,jj) = grav * ( 1. + cevap*zrv*ziRT ) / ( Cp_dry + cevap*cevap*zrv*reps0*ziRT/ptak(ji,jj) )
+         END DO
+      END DO
+      !
+   END FUNCTION gamma_moist
+
+
+   FUNCTION L_vap( psst )
+      !!---------------------------------------------------------------------------------
+      !!                           ***  FUNCTION L_vap  ***
+      !!
+      !! ** Purpose : Compute the latent heat of vaporization of water from temperature
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   L_vap   ! latent heat of vaporization   [J/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   psst   ! water temperature                [K]
+      !!----------------------------------------------------------------------------------
+      !
+      L_vap = (  2.501 - 0.00237 * ( psst(:,:) - rt0)  ) * 1.e6
+      !
+   END FUNCTION L_vap
+
+   !!======================================================================
+END MODULE sbcblk
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90	(revision 7280)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare.F90	(revision 7280)
@@ -0,0 +1,454 @@
+MODULE sbcblk_algo_coare
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk_algo_coare  ***
+   !! Computes turbulent components of surface fluxes
+   !!         according to Fairall et al. 2003 (COARE v3)
+   !!
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at 10m U_blk
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!    Using the bulk formulation/param. of COARE v3, Fairall et al. 2003
+   !!
+   !!
+   !!       Routine turb_coare maintained and developed in AeroBulk
+   !!                     (http://aerobulk.sourceforge.net/)
+   !!
+   !!            Author: Laurent Brodeau, 2016, brodeau@gmail.com
+   !!
+   !!======================================================================
+   !! History :  3.6  !  2016-02  (L.Brodeau)   Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   turb_coare  : computes the bulk turbulent transfer coefficients
+   !!                   adjusts t_air and q_air from zt to zu m
+   !!                   returns the effective bulk wind speed at 10m
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE phycst         ! physical constants
+   USE sbc_oce        ! Surface boundary condition: ocean fields
+   USE sbcwave, ONLY  :  cdn_wave ! wave module
+#if defined key_lim3 || defined key_cice
+   USE sbc_ice        ! Surface boundary condition: ice fields
+#endif
+   !
+   USE in_out_manager ! I/O manager
+   USE iom            ! I/O manager library
+   USE lib_mpp        ! distribued memory computing library
+   USE wrk_nemo       ! work arrays
+   USE timing         ! Timing
+   USE prtctl         ! Print control
+   USE lib_fortran    ! to use key_nosignedzero
+
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ::   TURB_COARE   ! called by sbcblk.F90
+
+   !! COARE own values for given constants:
+   REAL(wp), PARAMETER :: &
+      &   zi0     = 600.,  &   !: scale height of the atmospheric boundary layer...1
+      &  Beta0    = 1.25, &   !: gustiness parameter
+      &  rctv0    = 0.608     !: constant to obtain virtual temperature...
+
+
+CONTAINS
+
+   SUBROUTINE turb_coare( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
+      &                   Cd, Ch, Ce, t_zu, q_zu, U_blk )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_coare  ***
+      !!
+      !!            2015: L. Brodeau (brodeau@gmail.com)
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to Fairall et al. (2003)
+      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!
+      !! ** Method : Monin Obukhov Similarity Theory
+      !!----------------------------------------------------------------------
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (generally 10m)                   [m]
+      !!    *  U_zu : scalar wind speed at 10m                                [m/s]
+      !!    *  sst  : SST                                                     [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd     : drag coefficient
+      !!    *  Ch     : sensible heat coefficient
+      !!    *  Ce     : evaporation coefficient
+      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
+      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
+      !!    *  U_blk  : bulk wind at 10m                                      [m/s]
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                             [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature                [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity           [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity at zt             [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind at 10m                          [m/s]
+      !
+      INTEGER :: j_itt
+      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      INTEGER , PARAMETER ::   nb_itt = 4       ! number of itterations
+
+      REAL(wp), DIMENSION(:,:), POINTER  ::  &
+         &  u_star, t_star, q_star, &
+         &  dt_zu, dq_zu,    &
+         &  znu_a,           & !: Nu_air, Viscosity of air
+         &  z0, z0t
+      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_u        ! stability parameter at height zu
+      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_t        ! stability parameter at height zt
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('turb_coare')
+
+      CALL wrk_alloc( jpi,jpj,   u_star, t_star, q_star, zeta_u, dt_zu, dq_zu)
+      CALL wrk_alloc( jpi,jpj,   znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
+
+      l_zt_equal_zu = .FALSE.
+      IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
+
+      IF( .NOT. l_zt_equal_zu )   CALL wrk_alloc( jpi,jpj, zeta_t )
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu = MAX(t_zt , 0.0)    ! who knows what's given on masked-continental regions...
+      q_zu = MAX(q_zt , 1.e-6)  !               "
+
+      !! Pot. temp. difference (and we don't want it to be 0!)
+      dt_zu = t_zu - sst ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+      dq_zu = q_zu - ssq ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+
+      znu_a = visc_air(t_zt) ! Air viscosity (m^2/s) at zt given from temperature in (K)
+
+      ztmp2 = 0.5*0.5  ! initial guess for wind gustiness contribution
+      U_blk = SQRT(U_zu*U_zu + ztmp2)
+
+      ztmp2   = 10000.     ! optimization: ztmp2 == 1/z0 (with z0 first guess == 0.0001)
+      ztmp0   = LOG(zu*ztmp2)
+      ztmp1   = LOG(10.*ztmp2)
+      u_star = 0.035*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+
+      z0     = alfa_charn(U_blk)*u_star*u_star/grav + 0.11*znu_a/u_star
+      z0t    = 0.1*EXP(vkarmn/(0.00115/(vkarmn/ztmp1)))   !  WARNING: 1/z0t !
+
+      ztmp2  = vkarmn/ztmp0
+      Cd     = ztmp2*ztmp2    ! first guess of Cd
+
+      ztmp0 = vkarmn*vkarmn/LOG(zt*z0t)/Cd
+
+      !Ribcu = -zu/(zi0*0.004*Beta0**3) !! Saturation Rib, zi0 = tropicalbound. layer depth
+      ztmp2  = grav*zu*(dt_zu + rctv0*t_zu*dq_zu)/(t_zu*U_blk*U_blk)  !! Ribu Bulk Richardson number
+      ztmp1 = 0.5 + sign(0.5 , ztmp2)
+      ztmp0 = ztmp0*ztmp2
+      !!             Ribu < 0                                 Ribu > 0   Beta = 1.25
+      zeta_u = (1.-ztmp1) * (ztmp0/(1.+ztmp2/(-zu/(zi0*0.004*Beta0**3)))) &
+         &  +     ztmp1   * (ztmp0*(1. + 27./9.*ztmp2/ztmp0))
+
+      !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
+      ztmp0  =  vkarmn/(LOG(zu*z0t) - psi_h_coare(zeta_u))
+
+      u_star = U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u))
+      t_star = dt_zu*ztmp0
+      q_star = dq_zu*ztmp0
+
+      ! What's need to be done if zt /= zu:
+      IF( .NOT. l_zt_equal_zu ) THEN
+
+         zeta_t = zt*zeta_u/zu
+
+         !! First update of values at zu (or zt for wind)
+         ztmp0 = psi_h_coare(zeta_u) - psi_h_coare(zeta_t)
+         ztmp1 = log(zt/zu) + ztmp0
+         t_zu = t_zt - t_star/vkarmn*ztmp1
+         q_zu = q_zt - q_star/vkarmn*ztmp1
+         q_zu = (0.5 + sign(0.5,q_zu))*q_zu !Makes it impossible to have negative humidity :
+
+         dt_zu = t_zu - sst  ; dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+         dq_zu = q_zu - ssq  ; dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+
+      END IF
+
+      !! ITERATION BLOCK
+      DO j_itt = 1, nb_itt
+
+         !!Inverse of Monin-Obukov length (1/L) :
+         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Monin-Obukhov length]
+
+         ztmp1 = u_star*u_star   ! u*^2
+
+         !! Update wind at 10m taking into acount convection-related wind gustiness:
+         ! Ug = Beta*w*  (Beta = 1.25, Fairall et al. 2003, Eq.8):
+         ztmp2 = Beta0*Beta0*ztmp1*(MAX(-zi0*ztmp0/vkarmn,0.))**(2./3.)   ! => ztmp2 == Ug^2
+         !!   ! Only true when unstable (L<0) => when ztmp0 < 0 => explains "-" before 600.
+         U_blk = MAX(sqrt(U_zu*U_zu + ztmp2), 0.2)        ! include gustiness in bulk wind speed
+         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+
+         !! Updating Charnock parameter, increases with the wind (Fairall et al., 2003 p. 577-578)
+         ztmp2 = alfa_charn(U_blk)  ! alpha Charnock parameter
+
+         !! Roughness lengthes z0, z0t (z0q = z0t) :
+         z0   = ztmp2*ztmp1/grav + 0.11*znu_a/u_star ! Roughness length (eq.6)
+         ztmp1 = z0*u_star/znu_a                             ! Re_r: roughness Reynolds number
+         z0t  = min( 1.1E-4 , 5.5E-5*ztmp1**(-0.6) )         ! Scalar roughness for both theta and q (eq.28)
+
+         !! Stability parameters:
+         zeta_u = zu*ztmp0 ; zeta_u = sign( min(abs(zeta_u),50.0), zeta_u )
+         IF( .NOT. l_zt_equal_zu ) THEN
+            zeta_t = zt*ztmp0 ;  zeta_t = sign( min(abs(zeta_t),50.0), zeta_t )
+         END IF
+
+         !! Turbulent scales at zu=10m :
+         ztmp0   = psi_h_coare(zeta_u)
+         ztmp1   = vkarmn/(LOG(zu) -LOG(z0t) - ztmp0)
+
+         t_star = dt_zu*ztmp1
+         q_star = dq_zu*ztmp1
+         u_star = U_blk*vkarmn/(LOG(zu) -LOG(z0) - psi_m_coare(zeta_u))
+
+         IF( .NOT. l_zt_equal_zu ) THEN
+            ! What's need to be done if zt /= zu
+            !! Re-updating temperature and humidity at zu :
+            ztmp2 = ztmp0 - psi_h_coare(zeta_t)
+            ztmp1 = log(zt/zu) + ztmp2
+            t_zu = t_zt - t_star/vkarmn*ztmp1
+            q_zu = q_zt - q_star/vkarmn*ztmp1
+            dt_zu = t_zu - sst ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+            dq_zu = q_zu - ssq ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+         END IF
+
+      END DO
+      !
+      ! compute transfer coefficients at zu :
+      ztmp0 = u_star/U_blk
+      Cd   = ztmp0*ztmp0
+      Ch   = ztmp0*t_star/dt_zu
+      Ce   = ztmp0*q_star/dq_zu
+      !
+      CALL wrk_dealloc( jpi,jpj, u_star, t_star, q_star, zeta_u, dt_zu, dq_zu )
+      CALL wrk_dealloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
+      IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t )
+
+      IF( nn_timing == 1 )  CALL timing_stop('turb_coare')
+
+   END SUBROUTINE turb_coare
+
+
+   FUNCTION alfa_charn( pwnd )
+      !!-------------------------------------------------------------------
+      !! Compute the Charnock parameter as a function of the wind speed
+      !!
+      !! (Fairall et al., 2003 p.577-578)
+      !!
+      !! Wind below 10 m/s :  alfa = 0.011
+      !! Wind between 10 and 18 m/s : linear increase from 0.011 to 0.018
+      !! Wind greater than 18 m/s :  alfa = 0.018
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk  (https://sourceforge.net/p/aerobulk)
+      !!-------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: alfa_charn
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pwnd   ! wind speed
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) :: zw, zgt10, zgt18
+      !!-------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zw = pwnd(ji,jj)   ! wind speed
+            !
+            ! Charnock's constant, increases with the wind :
+            zgt10 = 0.5 + SIGN(0.5,(zw - 10.)) ! If zw<10. --> 0, else --> 1
+            zgt18 = 0.5 + SIGN(0.5,(zw - 18.)) ! If zw<18. --> 0, else --> 1
+            !
+            alfa_charn(ji,jj) =  (1. - zgt10)*0.011    &    ! wind is lower than 10 m/s
+               &     + zgt10*((1. - zgt18)*(0.011 + (0.018 - 0.011) &
+               &      *(zw - 10.)/(18. - 10.)) + zgt18*( 0.018 ) )    ! Hare et al. (1999)
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION alfa_charn
+
+
+   FUNCTION One_on_L( ptha, pqa, pus, pts, pqs )
+      !!------------------------------------------------------------------------
+      !!
+      !! Evaluates the 1./(Monin Obukhov length) from air temperature and
+      !!  specific humidity, and frictional scales u*, t* and q*
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: One_on_L         !: 1./(Monin Obukhov length) [m^-1]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha,  &  !: average potetntial air temperature [K]
+         &                                        pqa,   &  !: average specific humidity of air   [kg/kg]
+         &                                      pus, pts, pqs   !: frictional velocity, temperature and humidity
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::     zqa          ! local scalar
+      !!-------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zqa = (1. + rctv0*pqa(ji,jj))
+            !
+            One_on_L(ji,jj) =  grav*vkarmn*(pts(ji,jj)*zqa + rctv0*ptha(ji,jj)*pqs(ji,jj)) &
+               &                      / ( pus(ji,jj)*pus(ji,jj) * ptha(ji,jj)*zqa )
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION One_on_L
+
+
+   FUNCTION psi_m_coare( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! ** Purpose: compute the universal profile stability function for momentum
+      !!             COARE 3.0, Fairall et al. 2003
+      !!             pzeta : stability paramenter, z/L where z is altitude
+      !!                     measurement and L is M-O length
+      !!       Stability function for wind speed and scalars matching Kansas and free
+      !!       convection forms with weighting f convective form, follows Fairall et
+      !!       al (1996) with profile constants from Grachev et al (2000) BLM stable
+      !!       form from Beljaars and Holtslag (1991)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_coare
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zta, zphi_m, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+            !
+            zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+               & - 2.*ATAN(zphi_m) + 0.5*rpi
+            !
+            zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50., 0.35*zta)
+            zstab = 0.5 + SIGN(0.5, zta)
+            !
+            psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+               &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+               &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_m_coare
+
+
+   FUNCTION psi_h_coare( pzeta )
+      !!---------------------------------------------------------------------
+      !! Universal profile stability function for temperature and humidity
+      !! COARE 3.0, Fairall et al. 2003
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! Stability function for wind speed and scalars matching Kansas and free
+      !! convection forms with weighting f convective form, follows Fairall et
+      !! al (1996) with profile constants from Grachev et al (2000) BLM stable
+      !! form from Beljaars and Holtslag (1991)
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------
+      !!
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_coare
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+            !
+            zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+            !
+            zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50.,0.35*zta)
+            zstab = 0.5 + SIGN(0.5, zta)
+            !
+            psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+               &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+               &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_h_coare
+
+
+   FUNCTION visc_air( ptak )
+      !!---------------------------------------------------------------------
+      !! Air kinetic viscosity (m^2/s) given from temperature in degrees...
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!---------------------------------------------------------------------
+      !!
+      REAL(wp), DIMENSION(jpi,jpj) :: visc_air
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptak  ! air temperature in (K)
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::   ztc, ztc2      ! local scalar
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            ztc  = ptak(ji,jj) - rt0   ! air temp, in deg. C
+            ztc2 = ztc*ztc
+            visc_air(ji,jj) = 1.326E-5*(1. + 6.542E-3*ztc + 8.301E-6*ztc2 - 4.84E-9*ztc2*ztc)
+         END DO
+      END DO
+      !
+   END FUNCTION visc_air
+
+
+END MODULE sbcblk_algo_coare
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90	(revision 7280)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_coare3p5.F90	(revision 7280)
@@ -0,0 +1,421 @@
+MODULE sbcblk_algo_coare3p5
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk_algo_coare3p5  ***
+   !! Computes turbulent components of surface fluxes
+   !!         according to Edson et al. 2013 (COARE v3.5) /JPO
+   !!
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at 10m U_blk
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!    Using the bulk formulation/param. of COARE v3.5, Edson et al. 2013
+   !!
+   !!
+   !!       Routine turb_coare3p5 maintained and developed in AeroBulk
+   !!                     (http://aerobulk.sourceforge.net/)
+   !!
+   !!            Author: Laurent Brodeau, 2016, brodeau@gmail.com
+   !!
+   !!======================================================================
+   !! History :  3.6  !  2016-02  (L.Brodeau)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   turb_coare3p5  : computes the bulk turbulent transfer coefficients
+   !!                   adjusts t_air and q_air from zt to zu m
+   !!                   returns the effective bulk wind speed at 10m
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbcwave, ONLY   :  cdn_wave ! wave module
+#if defined key_lim3 || defined key_cice
+   USE sbc_ice         ! Surface boundary condition: ice fields
+#endif
+   !
+   USE iom             ! I/O manager library
+   USE lib_mpp         ! distribued memory computing library
+   USE wrk_nemo        ! work arrays
+   USE timing          ! Timing
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+   USE lib_fortran     ! to use key_nosignedzero
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ::   TURB_COARE3P5   ! called by sbcblk.F90
+
+   !                                   ! COARE own values for given constants:
+   REAL(wp), PARAMETER ::   charn0_max =   0.028   ! value above which the Charnock paramter levels off for winds > 18
+   REAL(wp), PARAMETER ::   zi0        = 600.      ! scale height of the atmospheric boundary layer...1
+   REAL(wp), PARAMETER ::   Beta0      =   1.25    ! gustiness parameter
+   REAL(wp), PARAMETER ::   rctv0      =   0.608   ! constant to obtain virtual temperature...
+
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_coare3p5( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
+      &                   Cd, Ch, Ce, t_zu, q_zu, U_blk )
+      !!----------------------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_coare3p5  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to Fairall et al. (2003)
+      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!
+      !! ** Method : Monin Obukhov Similarity Theory
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk) 
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (generally 10m)                   [m]
+      !!    *  U_zu : scalar wind speed at 10m                                [m/s]
+      !!    *  sst  : SST                                                     [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd     : drag coefficient
+      !!    *  Ch     : sensible heat coefficient
+      !!    *  Ce     : evaporation coefficient
+      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
+      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
+      !!    *  U_blk  : bulk wind at 10m                                      [m/s]
+      !!
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                   [m]
+      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                              [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature              [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature            [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity         [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity                 [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu            [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu             [K]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu             [kg/kg]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind at 10m                          [m/s]
+      !
+      INTEGER :: j_itt
+      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      INTEGER , PARAMETER ::   nb_itt = 4       ! number of itterations
+      !
+      REAL(wp), DIMENSION(:,:), POINTER  ::  &
+         &  u_star, t_star, q_star, &
+         &  dt_zu, dq_zu,    &
+         &  znu_a,           & !: Nu_air, Viscosity of air
+         &  z0, z0t
+      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_u        ! stability parameter at height zu
+      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_t        ! stability parameter at height zt
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
+      !!----------------------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )  CALL timing_start('turb_coare3p5')
+
+      CALL wrk_alloc( jpi,jpj, u_star, t_star, q_star, zeta_u, dt_zu, dq_zu)
+      CALL wrk_alloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
+
+      l_zt_equal_zu = .FALSE.
+      IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
+
+      IF( .NOT. l_zt_equal_zu )   CALL wrk_alloc( jpi,jpj, zeta_t )
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu = MAX(t_zt , 0.0)    ! who knows what's given on masked-continental regions...
+      q_zu = MAX(q_zt , 1.E-6)  !               "
+
+      !! Pot. temp. difference (and we don't want it to be 0!)
+      dt_zu = t_zu - sst ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+      dq_zu = q_zu - ssq ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+
+      znu_a = visc_air(t_zt) ! Air viscosity (m^2/s) at zt given from temperature in (K)
+
+      ztmp2 = 0.5*0.5  ! initial guess for wind gustiness contribution
+      U_blk = SQRT(U_zu*U_zu + ztmp2)
+
+      ztmp2   = 10000.     ! optimization: ztmp2 == 1/z0 (with z0 first guess == 0.0001)
+      ztmp0   = LOG(zu*ztmp2)
+      ztmp1   = LOG(10.*ztmp2)
+      u_star = 0.035*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+      !! COARE 3.5 first guess of UN10 is U_zu
+      ztmp2 = MIN( 0.0017*U_zu - 0.005 , charn0_max)  ! alpha Charnock parameter (Eq. 13 Edson al. 2013)
+      ztmp2 = MAX( ztmp2 , 0. )                       ! alpha Charnock parameter (Eq. 13 Edson al. 2013)
+      z0     = ztmp2*u_star*u_star/grav + 0.11*znu_a/u_star
+      z0t    = 0.1*EXP(vkarmn/(0.00115/(vkarmn/ztmp1)))   !  WARNING: 1/z0t !
+
+      ztmp2  = vkarmn/ztmp0
+      Cd     = ztmp2*ztmp2    ! first guess of Cd
+
+      ztmp0 = vkarmn*vkarmn/LOG(zt*z0t)/Cd
+
+      !Ribcu = -zu/(zi0*0.004*Beta0**3) !! Saturation Rib, zi0 = tropicalbound. layer depth
+      ztmp2  = grav*zu*(dt_zu + rctv0*t_zu*dq_zu)/(t_zu*U_blk*U_blk)  !! Ribu Bulk Richardson number
+      ztmp1 = 0.5 + sign(0.5 , ztmp2)
+      ztmp0 = ztmp0*ztmp2
+      !!             Ribu < 0                                 Ribu > 0   Beta = 1.25
+      zeta_u = (1.-ztmp1) * (ztmp0/(1.+ztmp2/(-zu/(zi0*0.004*Beta0**3)))) &
+         &  +     ztmp1   * (ztmp0*(1. + 27./9.*ztmp2/ztmp0))
+
+      !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
+      ztmp0  =  vkarmn/(LOG(zu*z0t) - psi_h_coare(zeta_u))
+
+      u_star = U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_coare(zeta_u))
+      t_star = dt_zu*ztmp0
+      q_star = dq_zu*ztmp0
+
+      ! What's need to be done if zt /= zu:
+      IF( .NOT. l_zt_equal_zu ) THEN
+
+         zeta_t = zt*zeta_u/zu
+
+         !! First update of values at zu (or zt for wind)
+         ztmp0 = psi_h_coare(zeta_u) - psi_h_coare(zeta_t)
+         ztmp1 = log(zt/zu) + ztmp0
+         t_zu = t_zt - t_star/vkarmn*ztmp1
+         q_zu = q_zt - q_star/vkarmn*ztmp1
+         q_zu = (0.5 + sign(0.5,q_zu))*q_zu !Makes it impossible to have negative humidity :
+
+         dt_zu = t_zu - sst  ; dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+         dq_zu = q_zu - ssq  ; dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+
+      END IF
+
+      !! ITERATION BLOCK
+      DO j_itt = 1, nb_itt
+
+         !!Inverse of Monin-Obukov length (1/L) :
+         ztmp0 = One_on_L(t_zu, q_zu, u_star, t_star, q_star)  ! 1/L == 1/[Monin-Obukhov length]
+
+         ztmp1 = u_star*u_star   ! u*^2
+
+         !! Update wind at 10m taking into acount convection-related wind gustiness:
+         ! Ug = Beta*w*  (Beta = 1.25, Fairall et al. 2003, Eq.8):
+         ztmp2 = Beta0*Beta0*ztmp1*(MAX(-zi0*ztmp0/vkarmn,0.))**(2./3.)   ! => ztmp2 == Ug^2
+         !!   ! Only true when unstable (L<0) => when ztmp0 < 0 => explains "-" before 600.
+         U_blk = MAX(sqrt(U_zu*U_zu + ztmp2), 0.2)        ! include gustiness in bulk wind speed
+         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+
+         !! COARE 3.5: Charnock parameter is computed from the neutral wind speed at 10m: Eq. 13 (Edson al. 2013)
+         ztmp2 = u_star/vkarmn*LOG(10./z0)   ! UN10 Neutral wind at 10m!
+         ztmp2 = MIN( 0.0017*ztmp2 - 0.005 , charn0_max)  ! alpha Charnock parameter (Eq. 13 Edson al. 2013)
+         ztmp2 = MAX( ztmp2 , 0. )
+
+         !! Roughness lengthes z0, z0t (z0q = z0t) :
+         z0   = ztmp2*ztmp1/grav + 0.11*znu_a/u_star ! Roughness length (eq.6)
+         ztmp1 = z0*u_star/znu_a                             ! Re_r: roughness Reynolds number
+         !z0t  = MIN( 1.1E-4 , 5.5E-5*ztmp1**(-0.6) )   ! COARE 3.0
+         !! Chris Fairall and Jim Edsson, private communication, March 2016 / COARE 3.5 :
+         z0t   = MIN( 1.6e-4 , 5.8E-5*ztmp1**(-0.72)) ! These thermal roughness lengths give Stanton and
+         !z0q = z0t                                   ! Dalton numbers that closely approximate COARE3.0
+
+         !! Stability parameters:
+         zeta_u = zu*ztmp0 ; zeta_u = sign( min(abs(zeta_u),50.0), zeta_u )
+         IF( .NOT. l_zt_equal_zu ) THEN
+            zeta_t = zt*ztmp0 ;  zeta_t = sign( min(abs(zeta_t),50.0), zeta_t )
+         END IF
+
+         !! Turbulent scales at zu=10m :
+         ztmp0   = psi_h_coare(zeta_u)
+         ztmp1   = vkarmn/(LOG(zu) -LOG(z0t) - ztmp0)
+
+         t_star = dt_zu*ztmp1
+         q_star = dq_zu*ztmp1
+         u_star = U_blk*vkarmn/(LOG(zu) -LOG(z0) - psi_m_coare(zeta_u))
+
+         IF( .NOT. l_zt_equal_zu ) THEN
+            ! What's need to be done if zt /= zu
+            !! Re-updating temperature and humidity at zu :
+            ztmp2 = ztmp0 - psi_h_coare(zeta_t)
+            ztmp1 = log(zt/zu) + ztmp2
+            t_zu = t_zt - t_star/vkarmn*ztmp1
+            q_zu = q_zt - q_star/vkarmn*ztmp1
+            dt_zu = t_zu - sst ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+            dq_zu = q_zu - ssq ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+         END IF
+
+      END DO
+      !
+      ! compute transfer coefficients at zu :
+      ztmp0 = u_star/U_blk
+      Cd   = ztmp0*ztmp0
+      Ch   = ztmp0*t_star/dt_zu
+      Ce   = ztmp0*q_star/dq_zu
+      !
+      CALL wrk_dealloc( jpi,jpj, u_star, t_star, q_star, zeta_u, dt_zu, dq_zu )
+      CALL wrk_dealloc( jpi,jpj, znu_a, z0, z0t, ztmp0, ztmp1, ztmp2 )
+      IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t )
+
+      IF( nn_timing == 1 )  CALL timing_stop('turb_coare3p5')
+
+   END SUBROUTINE turb_coare3p5
+
+
+
+   FUNCTION One_on_L( ptha, pqa, pus, pts, pqs )
+      !!------------------------------------------------------------------------
+      !!
+      !! Evaluates the 1./(Monin Obukhov length) from air temperature and
+      !!  specific humidity, and frictional scales u*, t* and q*
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             :: One_on_L         !: 1./(Monin Obukhov length) [m^-1]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: ptha,  &  !: average potetntial air temperature [K]
+         &                                        pqa,   &  !: average specific humidity of air   [kg/kg]
+         &                                      pus, pts, pqs   !: frictional velocity, temperature and humidity
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::     zqa          ! local scalar
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zqa = (1. + rctv0*pqa(ji,jj))
+            !
+            One_on_L(ji,jj) =  grav*vkarmn*(pts(ji,jj)*zqa + rctv0*ptha(ji,jj)*pqs(ji,jj)) &
+               &                      / ( pus(ji,jj)*pus(ji,jj) * ptha(ji,jj)*zqa )
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION One_on_L
+
+
+   FUNCTION psi_m_coare( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! ** Purpose: compute the universal profile stability function for momentum
+      !!             COARE 3.0, Fairall et al. 2003
+      !!             pzeta : stability paramenter, z/L where z is altitude
+      !!                     measurement and L is M-O length
+      !!       Stability function for wind speed and scalars matching Kansas and free
+      !!       convection forms with weighting f convective form, follows Fairall et
+      !!       al (1996) with profile constants from Grachev et al (2000) BLM stable
+      !!       form from Beljaars and Holtslag (1991)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_coare
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zta, zphi_m, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_m = ABS(1. - 15.*zta)**.25    !!Kansas unstable
+            !
+            zpsi_k = 2.*LOG((1. + zphi_m)/2.) + LOG((1. + zphi_m*zphi_m)/2.)   &
+               & - 2.*ATAN(zphi_m) + 0.5*rpi
+            !
+            zphi_c = ABS(1. - 10.15*zta)**.3333                   !!Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &     - 1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50., 0.35*zta)
+            zstab = 0.5 + SIGN(0.5, zta)
+            !
+            psi_m_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) & ! (zta < 0)
+               &                -   zstab     * ( 1. + 1.*zta     &                ! (zta > 0)
+               &                         + 0.6667*(zta - 14.28)/EXP(zc) + 8.525 )   !     "
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_m_coare
+
+
+   FUNCTION psi_h_coare( pzeta )
+      !!---------------------------------------------------------------------
+      !! Universal profile stability function for temperature and humidity
+      !! COARE 3.0, Fairall et al. 2003
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! Stability function for wind speed and scalars matching Kansas and free
+      !! convection forms with weighting f convective form, follows Fairall et
+      !! al (1996) with profile constants from Grachev et al (2000) BLM stable
+      !! form from Beljaars and Holtslag (1991)
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------
+      !!
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_coare
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zta = pzeta(ji,jj)
+            !
+            zphi_h = (ABS(1. - 15.*zta))**.5  !! Kansas unstable   (zphi_h = zphi_m**2 when unstable, zphi_m when stable)
+            !
+            zpsi_k = 2.*LOG((1. + zphi_h)/2.)
+            !
+            zphi_c = (ABS(1. - 34.15*zta))**.3333   !! Convective
+            !
+            zpsi_c = 1.5*LOG((1. + zphi_c + zphi_c*zphi_c)/3.) &
+               &    -1.7320508*ATAN((1. + 2.*zphi_c)/1.7320508) + 1.813799447
+            !
+            zf = zta*zta
+            zf = zf/(1. + zf)
+            zc = MIN(50.,0.35*zta)
+            zstab = 0.5 + SIGN(0.5, zta)
+            !
+            psi_h_coare(ji,jj) = (1. - zstab) * ( (1. - zf)*zpsi_k + zf*zpsi_c ) &
+               &                -   zstab     * ( (ABS(1. + 2.*zta/3.))**1.5     &
+               &                           + .6667*(zta - 14.28)/EXP(zc) + 8.525 )
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_h_coare
+
+
+   FUNCTION visc_air( ptak )
+      !!---------------------------------------------------------------------
+      !! Air kinetic viscosity (m^2/s) given from temperature in degrees...
+      !!
+      !! Author: L. Brodeau, june 2016 / AeroBulk
+      !!         (https://sourceforge.net/p/aerobulk)
+      !!---------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   visc_air
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak       ! air temperature   [K]
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) ::   ztc, ztc2      ! local scalar
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            ztc  = ptak(ji,jj) - rt0   ! air temp, in deg. C
+            ztc2 = ztc*ztc
+            visc_air(ji,jj) = 1.326E-5*(1. + 6.542E-3*ztc + 8.301E-6*ztc2 - 4.84E-9*ztc2*ztc)
+         END DO
+      END DO
+      !
+   END FUNCTION visc_air
+
+   !!======================================================================
+END MODULE sbcblk_algo_coare3p5
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90	(revision 7280)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ecmwf.F90	(revision 7280)
@@ -0,0 +1,431 @@
+MODULE sbcblk_algo_ecmwf
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk_algo_ecmwf  ***
+   !! Computes turbulent components of surface fluxes
+   !!         according to the method in IFS of the ECMWF model
+   !!
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at 10m U_blk
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!    Using the bulk formulation/param. of IFS of ECMWF (cycle 31r2)
+   !!         based on IFS doc (avaible online on the ECMWF's website)
+   !!
+   !!
+   !!       Routine turb_ecmwf maintained and developed in AeroBulk
+   !!                     (http://aerobulk.sourceforge.net/)
+   !!
+   !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+   !!----------------------------------------------------------------------
+   !! History :  4.0  !  2016-02  (L.Brodeau)   Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   turb_ecmwf  : computes the bulk turbulent transfer coefficients
+   !!                   adjusts t_air and q_air from zt to zu m
+   !!                   returns the effective bulk wind speed at 10m
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE iom             ! I/O manager library
+   USE lib_mpp         ! distribued memory computing library
+   USE wrk_nemo        ! work arrays
+   USE timing          ! Timing
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+   USE sbcwave, ONLY   :  cdn_wave ! wave module
+#if defined key_lim3 || defined key_cice
+   USE sbc_ice         ! Surface boundary condition: ice fields
+#endif
+   USE lib_fortran     ! to use key_nosignedzero
+
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ::   TURB_ECMWF   ! called by sbcblk.F90
+
+   !                   !! ECMWF own values for given constants, taken form IFS documentation...
+   REAL(wp), PARAMETER ::   charn0 = 0.018    ! Charnock constant (pretty high value here !!!
+   !                                          !    =>  Usually 0.011 for moderate winds)
+   REAL(wp), PARAMETER ::   zi0     = 1000.   ! scale height of the atmospheric boundary layer...1
+   REAL(wp), PARAMETER ::   Beta0    = 1.     ! gustiness parameter ( = 1.25 in COAREv3)
+   REAL(wp), PARAMETER ::   rctv0    = 0.608  ! constant to obtain virtual temperature...
+   REAL(wp), PARAMETER ::   Cp_dry = 1005.0   ! Specic heat of dry air, constant pressure      [J/K/kg]
+   REAL(wp), PARAMETER ::   Cp_vap = 1860.0   ! Specic heat of water vapor, constant pressure  [J/K/kg]
+   REAL(wp), PARAMETER ::   alpha_M = 0.11    ! For roughness length (smooth surface term)
+   REAL(wp), PARAMETER ::   alpha_H = 0.40    ! (Chapter 3, p.34, IFS doc Cy31r1)
+   REAL(wp), PARAMETER ::   alpha_Q = 0.62    !
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE TURB_ECMWF( zt, zu, sst, t_zt, ssq , q_zt , U_zu,   &
+      &                   Cd, Ch, Ce , t_zu, q_zu, U_blk )
+      !!----------------------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_ecmwf  ***
+      !!
+      !!            2015: L. Brodeau (brodeau@gmail.com)
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to IFS doc. (cycle 31)
+      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!
+      !! ** Method : Monin Obukhov Similarity Theory
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (generally 10m)                   [m]
+      !!    *  U_zu : scalar wind speed at 10m                                [m/s]
+      !!    *  sst  : SST                                                     [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd     : drag coefficient
+      !!    *  Ch     : sensible heat coefficient
+      !!    *  Ce     : evaporation coefficient
+      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
+      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
+      !!    *  U_blk  : bulk wind at 10m                                      [m/s]
+      !!
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                             [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature                [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity           [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity                   [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind at 10m                          [m/s]
+      !
+      INTEGER :: j_itt
+      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      INTEGER , PARAMETER ::   nb_itt = 4       ! number of itterations
+      !
+      REAL(wp), DIMENSION(:,:), POINTER  ::   u_star, t_star, q_star,   &
+         &  dt_zu, dq_zu,    &
+         &  znu_a,           & !: Nu_air, Viscosity of air
+         &  Linv,            & !: 1/L (inverse of Monin Obukhov length...
+         &  z0, z0t, z0q
+      REAL(wp), DIMENSION(:,:), POINTER ::   func_m, func_h
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
+      !!----------------------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('turb_ecmwf')
+      !
+      CALL wrk_alloc( jpi,jpj,   u_star, t_star, q_star, func_m, func_h, dt_zu, dq_zu, Linv )
+      CALL wrk_alloc( jpi,jpj,   znu_a, z0, z0t, z0q, ztmp0, ztmp1, ztmp2 )
+      !
+      ! Identical first gess as in COARE, with IFS parameter values though
+      !
+      l_zt_equal_zu = .FALSE.
+      IF( ABS(zu - zt) < 0.01 )   l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
+
+
+      !! First guess of temperature and humidity at height zu:
+      t_zu = MAX( t_zt , 0.0  )   ! who knows what's given on masked-continental regions...
+      q_zu = MAX( q_zt , 1.e-6)   !               "
+
+      !! Pot. temp. difference (and we don't want it to be 0!)
+      dt_zu = t_zu - sst   ;   dt_zu = SIGN( MAX(ABS(dt_zu),1.e-6), dt_zu )
+      dq_zu = q_zu - ssq   ;   dq_zu = SIGN( MAX(ABS(dq_zu),1.e-9), dq_zu )
+
+      znu_a = visc_air(t_zt) ! Air viscosity (m^2/s) at zt given from temperature in (K)
+
+      ztmp2 = 0.5 * 0.5  ! initial guess for wind gustiness contribution
+      U_blk = SQRT(U_zu*U_zu + ztmp2)
+
+      ! z0     = 0.0001
+      ztmp2   = 10000.     ! optimization: ztmp2 == 1/z0
+      ztmp0   = LOG(zu*ztmp2)
+      ztmp1   = LOG(10.*ztmp2)
+      u_star = 0.035*U_blk*ztmp1/ztmp0       ! (u* = 0.035*Un10)
+
+      z0     = charn0*u_star*u_star/grav + 0.11*znu_a/u_star
+      z0t    = 0.1*EXP(vkarmn/(0.00115/(vkarmn/ztmp1)))   !  WARNING: 1/z0t !
+
+      Cd     = (vkarmn/ztmp0)**2    ! first guess of Cd
+
+      ztmp0 = vkarmn*vkarmn/LOG(zt*z0t)/Cd
+
+      ztmp2 = Ri_bulk( zu, t_zu, dt_zu, q_zu, dq_zu, U_blk )   ! Ribu = Bulk Richardson number
+
+      !! First estimate of zeta_u, depending on the stability, ie sign of Ribu (ztmp2):
+      ztmp1 = 0.5 + SIGN( 0.5 , ztmp2 )
+      func_m = ztmp0*ztmp2 ! temporary array !!
+      !!             Ribu < 0                                 Ribu > 0   Beta = 1.25
+      func_h = (1.-ztmp1)*(func_m/(1.+ztmp2/(-zu/(zi0*0.004*Beta0**3)))) &  ! temporary array !!! func_h == zeta_u
+         &  +     ztmp1*(func_m*(1. + 27./9.*ztmp2/ztmp0))
+
+      !! First guess M-O stability dependent scaling params.(u*,t*,q*) to estimate z0 and z/L
+      ztmp0   =        vkarmn/(LOG(zu*z0t) - psi_h_ecmwf(func_h))
+
+      u_star = U_blk*vkarmn/(LOG(zu) - LOG(z0)  - psi_m_ecmwf(func_h))
+      t_star = dt_zu*ztmp0
+      q_star = dq_zu*ztmp0
+
+      ! What's need to be done if zt /= zu:
+      IF( .NOT. l_zt_equal_zu ) THEN
+         !
+         !! First update of values at zu (or zt for wind)
+         ztmp0 = psi_h_ecmwf(func_h) - psi_h_ecmwf(zt*func_h/zu)    ! zt*func_h/zu == zeta_t
+         ztmp1 = log(zt/zu) + ztmp0
+         t_zu = t_zt - t_star/vkarmn*ztmp1
+         q_zu = q_zt - q_star/vkarmn*ztmp1
+         q_zu = (0.5 + sign(0.5,q_zu))*q_zu !Makes it impossible to have negative humidity :
+
+         dt_zu = t_zu - sst  ; dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+         dq_zu = q_zu - ssq  ; dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+         !
+      ENDIF
+
+
+      !! => that was same first guess as in COARE...
+
+
+      !! First guess of inverse of Monin-Obukov length (1/L) :
+      ztmp0 = (1. + rctv0*q_zu)  ! the factor to apply to temp. to get virt. temp...
+      Linv  =  grav*vkarmn*(t_star*ztmp0 + rctv0*t_zu*q_star) / ( u_star*u_star * t_zu*ztmp0 )
+
+      !! Functions such as  u* = U_blk*vkarmn/func_m
+      ztmp1 = zu + z0
+      ztmp0 = ztmp1*Linv
+      func_m = LOG(ztmp1) -LOG(z0) - psi_m_ecmwf(ztmp0) + psi_m_ecmwf(z0*Linv)
+      func_h = LOG(ztmp1*z0t) - psi_h_ecmwf(ztmp0) + psi_h_ecmwf(1./z0t*Linv)
+
+
+      !! ITERATION BLOCK
+      !! ***************
+
+      DO j_itt = 1, nb_itt
+
+         !! Bulk Richardson Number at z=zu (Eq. 3.25)
+         ztmp0 = Ri_bulk(zu, t_zu, dt_zu, q_zu, dq_zu, U_blk)
+
+         !! New estimate of the inverse of the Monin-Obukhon length (Linv == zeta/zu) :
+         Linv = ztmp0*func_m*func_m/func_h / zu     ! From Eq. 3.23, Chap.3, p.33, IFS doc - Cy31r1
+
+         !! Update func_m with new Linv:
+         ztmp1 = zu + z0
+         func_m = LOG(ztmp1) -LOG(z0) - psi_m_ecmwf(ztmp1*Linv) + psi_m_ecmwf(z0*Linv)
+
+         !! Need to update roughness lengthes:
+         u_star = U_blk*vkarmn/func_m
+         ztmp2  = u_star*u_star
+         ztmp1  = znu_a/u_star
+         z0    = alpha_M*ztmp1 + charn0*ztmp2/grav
+         z0t    = alpha_H*ztmp1                              ! eq.3.26, Chap.3, p.34, IFS doc - Cy31r1
+         z0q    = alpha_Q*ztmp1
+
+         !! Update wind at 10m taking into acount convection-related wind gustiness:
+         ! Only true when unstable (L<0) => when ztmp0 < 0 => - !!!
+         ztmp2 = ztmp2 * (MAX(-zi0*Linv/vkarmn,0.))**(2./3.) ! => w*^2  (combining Eq. 3.8 and 3.18, hap.3, IFS doc - Cy31r1)
+         !! => equivalent using Beta=1 (gustiness parameter, 1.25 for COARE, also zi0=600 in COARE..)
+         U_blk = MAX(sqrt(U_zu*U_zu + ztmp2), 0.2)              ! eq.3.17, Chap.3, p.32, IFS doc - Cy31r1
+         ! => 0.2 prevents U_blk to be 0 in stable case when U_zu=0.
+
+
+         !! Need to update "theta" and "q" at zu in case they are given at different heights
+         !! as well the air-sea differences:
+         IF( .NOT. l_zt_equal_zu ) THEN
+
+            !! Arrays func_m and func_h are free for a while so using them as temporary arrays...
+            func_h = psi_h_ecmwf((zu+z0)*Linv) ! temporary array !!!
+            func_m = psi_h_ecmwf((zt+z0)*Linv) ! temporary array !!!
+
+            ztmp2  = psi_h_ecmwf(z0t*Linv)
+            ztmp0  = func_h - ztmp2
+            ztmp1  = vkarmn/(LOG(zu+z0) - LOG(z0t) - ztmp0)
+            t_star = dt_zu*ztmp1
+            ztmp2  = ztmp0 - func_m + ztmp2
+            ztmp1  = LOG(zt/zu) + ztmp2
+            t_zu   = t_zt - t_star/vkarmn*ztmp1
+
+            ztmp2  = psi_h_ecmwf(z0q*Linv)
+            ztmp0  = func_h - ztmp2
+            ztmp1  = vkarmn/(LOG(zu+z0) - LOG(z0q) - ztmp0)
+            q_star = dq_zu*ztmp1
+            ztmp2  = ztmp0 - func_m + ztmp2
+            ztmp1  = log(zt/zu) + ztmp2
+            q_zu   = q_zt - q_star/vkarmn*ztmp1
+
+            dt_zu = t_zu - sst ;  dt_zu = SIGN( MAX(ABS(dt_zu),1.E-6), dt_zu )
+            dq_zu = q_zu - ssq ;  dq_zu = SIGN( MAX(ABS(dq_zu),1.E-9), dq_zu )
+         END IF
+
+         !! Updating because of updated z0 and z0t and new Linv...
+         ztmp1 = zu + z0
+         ztmp0 = ztmp1*Linv
+         func_m = log(ztmp1) - LOG(z0) - psi_m_ecmwf(ztmp0) + psi_m_ecmwf(z0*Linv)
+         func_h = log(ztmp1) - LOG(z0t) - psi_h_ecmwf(ztmp0) + psi_h_ecmwf(z0t*Linv)
+
+      END DO
+
+      Cd = vkarmn*vkarmn/(func_m*func_m)
+      Ch = vkarmn*vkarmn/(func_m*func_h)
+      ztmp1 = log((zu + z0)/z0q) - psi_h_ecmwf((zu + z0)*Linv) + psi_h_ecmwf(z0q*Linv)   ! func_q
+      Ce = vkarmn*vkarmn/(func_m*ztmp1)
+
+      CALL wrk_dealloc( jpi,jpj,   u_star, t_star, q_star, func_m, func_h, dt_zu, dq_zu, Linv )
+      CALL wrk_dealloc( jpi,jpj,   znu_a, z0, z0t, z0q, ztmp0, ztmp1, ztmp2 )
+      !
+      IF( nn_timing == 1 )   CALL timing_stop('turb_ecmwf')
+      !
+   END SUBROUTINE TURB_ECMWF
+
+
+   FUNCTION psi_m_ecmwf( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! Universal profile stability function for momentum
+      !!     ECMWF / as in IFS cy31r1 documentation, available online
+      !!     at ecmwf.int
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_m_ecmwf
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zzeta, zx, ztmp, psi_unst, psi_stab, stab
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zzeta = MIN( pzeta(ji,jj) , 5. ) !! Very stable conditions (L positif and big!):
+            !
+            ! Unstable (Paulson 1970):
+            !   eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
+            zx = SQRT(ABS(1. - 16.*zzeta))
+            ztmp = 1. + SQRT(zx)
+            ztmp = ztmp*ztmp
+            psi_unst = LOG( 0.125*ztmp*(1. + zx) )   &
+               &       -2.*ATAN( SQRT(zx) ) + 0.5*rpi
+            !
+            ! Unstable:
+            ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
+            psi_stab = -2./3.*(zzeta - 5./0.35)*EXP(-0.35*zzeta) &
+               &       - zzeta - 2./3.*5./0.35
+            !
+            ! Combining:
+            stab = 0.5 + SIGN(0.5, zzeta) ! zzeta > 0 => stab = 1
+            !
+            psi_m_ecmwf(ji,jj) = (1. - stab) * psi_unst & ! (zzeta < 0) Unstable
+               &                +      stab  * psi_stab   ! (zzeta > 0) Stable
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_m_ecmwf
+
+   
+   FUNCTION psi_h_ecmwf( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! Universal profile stability function for temperature and humidity
+      !!     ECMWF / as in IFS cy31r1 documentation, available online
+      !!     at ecmwf.int
+      !!
+      !! pzeta : stability paramenter, z/L where z is altitude measurement
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) :: psi_h_ecmwf
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      !
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      REAL(wp) ::  zzeta, zx, psi_unst, psi_stab, stab
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zzeta = MIN(pzeta(ji,jj) , 5.)   ! Very stable conditions (L positif and big!):
+            !
+            zx  = ABS(1. - 16.*zzeta)**.25        ! this is actually (1/phi_m)**2  !!!
+            !                                     ! eq.3.19, Chap.3, p.33, IFS doc - Cy31r1
+            ! Unstable (Paulson 1970) :
+            psi_unst = 2.*LOG(0.5*(1. + zx*zx))   ! eq.3.20, Chap.3, p.33, IFS doc - Cy31r1
+            !
+            ! Stable:
+            psi_stab = -2./3.*(zzeta - 5./0.35)*EXP(-0.35*zzeta) & ! eq.3.22, Chap.3, p.33, IFS doc - Cy31r1
+               &       - ABS(1. + 2./3.*zzeta)**1.5 - 2./3.*5./0.35 + 1. 
+            ! LB: added ABS() to avoid NaN values when unstable, which contaminates the unstable solution...
+            !
+            stab = 0.5 + SIGN(0.5, zzeta) ! zzeta > 0 => stab = 1
+            !
+            !
+            psi_h_ecmwf(ji,jj) = (1. - stab) * psi_unst &   ! (zzeta < 0) Unstable
+               &                +    stab    * psi_stab     ! (zzeta > 0) Stable
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_h_ecmwf
+
+
+   FUNCTION Ri_bulk( pz, ptz, pdt, pqz, pdq, pub )
+      !!----------------------------------------------------------------------------------
+      !! Bulk Richardson number (Eq. 3.25 IFS doc)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj) ::   Ri_bulk   !
+      !
+      REAL(wp)                    , INTENT(in) ::   pz    ! height above the sea        [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptz   ! air temperature at pz m     [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pdt   ! ptz - sst                   [K]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqz   ! air temperature at pz m [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pdq   ! pqz - ssq               [kg/kg]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pub   ! bulk wind speed           [m/s]
+      !!----------------------------------------------------------------------------------
+      !
+      Ri_bulk =   grav*pz/(pub*pub)                                          &
+         &      * ( pdt/(ptz - 0.5_wp*(pdt + grav*pz/(Cp_dry+Cp_vap*pqz)))   &
+         &          + rctv0*pdq )
+      !
+   END FUNCTION Ri_bulk
+
+
+   FUNCTION visc_air(ptak)
+      !!----------------------------------------------------------------------------------
+      !! Air kinetic viscosity (m^2/s) given from temperature in degrees...
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   visc_air   !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   ptak       ! air temperature in (K)
+      !
+      INTEGER  ::   ji, jj      ! dummy loop indices
+      REAL(wp) ::   ztc, ztc2   ! local scalar
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            ztc  = ptak(ji,jj) - rt0   ! air temp, in deg. C
+            ztc2 = ztc*ztc
+            visc_air(ji,jj) = 1.326e-5*(1. + 6.542E-3*ztc + 8.301e-6*ztc2 - 4.84e-9*ztc2*ztc)
+         END DO
+      END DO
+      !
+   END FUNCTION visc_air
+
+   !!======================================================================
+END MODULE sbcblk_algo_ecmwf
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90	(revision 7280)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_algo_ncar.F90	(revision 7280)
@@ -0,0 +1,335 @@
+MODULE sbcblk_algo_ncar
+   !!======================================================================
+   !!                   ***  MODULE  sbcblk_algo_ncar  ***
+   !! Computes:
+   !!   * bulk transfer coefficients C_D, C_E and C_H
+   !!   * air temp. and spec. hum. adjusted from zt (2m) to zu (10m) if needed
+   !!   * the effective bulk wind speed at 10m U_blk
+   !!   => all these are used in bulk formulas in sbcblk.F90
+   !!
+   !!    Using the bulk formulation/param. of Large & Yeager 2008
+   !!
+   !!       Routine turb_ncar maintained and developed in AeroBulk
+   !!                     (http://aerobulk.sourceforge.net/)
+   !!
+   !!                         L. Brodeau, 2015
+   !!=====================================================================
+   !! History :  3.6  !  2016-02  (L.Brodeau) successor of old turb_ncar of former sbcblk_core.F90
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   turb_ncar  : computes the bulk turbulent transfer coefficients
+   !!                   adjusts t_air and q_air from zt to zu m
+   !!                   returns the effective bulk wind speed at 10m
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbcwave, ONLY   :  cdn_wave ! wave module
+#if defined key_lim3 || defined key_cice
+   USE sbc_ice         ! Surface boundary condition: ice fields
+#endif
+   !
+   USE iom             ! I/O manager library
+   USE lib_mpp         ! distribued memory computing library
+   USE wrk_nemo        ! work arrays
+   USE timing          ! Timing
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+   USE lib_fortran     ! to use key_nosignedzero
+
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ::   TURB_NCAR   ! called by sbcblk.F90
+
+   !                              ! NCAR own values for given constants:
+   REAL(wp), PARAMETER ::   rctv0 = 0.608   ! constant to obtain virtual temperature...
+   
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE turb_ncar( zt, zu, sst, t_zt, ssq, q_zt, U_zu, &
+      &                  Cd, Ch, Ce, t_zu, q_zu, U_blk )
+      !!----------------------------------------------------------------------------------
+      !!                      ***  ROUTINE  turb_ncar  ***
+      !!
+      !! ** Purpose :   Computes turbulent transfert coefficients of surface
+      !!                fluxes according to Large & Yeager (2004) and Large & Yeager (2008)
+      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
+      !!                Returns the effective bulk wind speed at 10m to be used in the bulk formulas
+      !!
+      !! ** Method : Monin Obukhov Similarity Theory
+      !!             + Large & Yeager (2004,2008) closure: CD_n10 = f(U_n10)
+      !!
+      !! ** References :   Large & Yeager, 2004 / Large & Yeager, 2008
+      !!
+      !! ** Last update: Laurent Brodeau, June 2014:
+      !!    - handles both cases zt=zu and zt/=zu
+      !!    - optimized: less 2D arrays allocated and less operations
+      !!    - better first guess of stability by checking air-sea difference of virtual temperature
+      !!       rather than temperature difference only...
+      !!    - added function "cd_neutral_10m" that uses the improved parametrization of
+      !!      Large & Yeager 2008. Drag-coefficient reduction for Cyclone conditions!
+      !!    - using code-wide physical constants defined into "phycst.mod" rather than redifining them
+      !!      => 'vkarmn' and 'grav'
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!
+      !! INPUT :
+      !! -------
+      !!    *  zt   : height for temperature and spec. hum. of air            [m]
+      !!    *  zu   : height for wind speed (generally 10m)                   [m]
+      !!    *  U_zu : scalar wind speed at 10m                                [m/s]
+      !!    *  sst  : SST                                                     [K]
+      !!    *  t_zt : potential air temperature at zt                         [K]
+      !!    *  ssq  : specific humidity at saturation at SST                  [kg/kg]
+      !!    *  q_zt : specific humidity of air at zt                          [kg/kg]
+      !!
+      !!
+      !! OUTPUT :
+      !! --------
+      !!    *  Cd     : drag coefficient
+      !!    *  Ch     : sensible heat coefficient
+      !!    *  Ce     : evaporation coefficient
+      !!    *  t_zu   : pot. air temperature adjusted at wind height zu       [K]
+      !!    *  q_zu   : specific humidity of air        //                    [kg/kg]
+      !!    *  U_blk  : bulk wind at 10m                                      [m/s]
+      !!----------------------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zt       ! height for t_zt and q_zt                    [m]
+      REAL(wp), INTENT(in   )                     ::   zu       ! height for U_zu                             [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature                [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   t_zt     ! potential air temperature              [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   ssq      ! sea surface specific humidity           [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity                   [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   U_zu     ! relative wind module at zu                [m/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   t_zu     ! pot. air temp. adjusted at zu               [K]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. humidity adjusted at zu           [kg/kg]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   U_blk    ! bulk wind at 10m                          [m/s]
+      !
+      INTEGER ::   j_itt
+      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at same height as U
+      INTEGER , PARAMETER ::   nb_itt = 4       ! number of itterations
+      !
+      REAL(wp), DIMENSION(:,:), POINTER ::   Cx_n10        ! 10m neutral latent/sensible coefficient
+      REAL(wp), DIMENSION(:,:), POINTER ::   sqrt_Cd_n10   ! root square of Cd_n10
+      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_u        ! stability parameter at height zu
+      REAL(wp), DIMENSION(:,:), POINTER ::   zpsi_h_u
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
+      REAL(wp), DIMENSION(:,:), POINTER ::   stab          ! stability test integer
+      !!----------------------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('turb_ncar')
+      !
+      CALL wrk_alloc( jpi,jpj,   Cx_n10, sqrt_Cd_n10, zeta_u, stab )
+      CALL wrk_alloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
+      !
+      l_zt_equal_zu = .FALSE.
+      IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
+
+      U_blk = MAX( 0.5 , U_zu )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
+
+      !! First guess of stability:
+      ztmp0 = t_zt*(1. + rctv0*q_zt) - sst*(1. + rctv0*ssq) ! air-sea difference of virtual pot. temp. at zt
+      stab  = 0.5 + sign(0.5,ztmp0)                           ! stab = 1 if dTv > 0  => STABLE, 0 if unstable
+
+      !! Neutral coefficients at 10m:
+      IF( ln_cdgw ) THEN      ! wave drag case
+         cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) )
+         ztmp0   (:,:) = cdn_wave(:,:)
+      ELSE
+         ztmp0 = cd_neutral_10m( U_blk )
+      ENDIF
+
+      sqrt_Cd_n10 = SQRT( ztmp0 )
+
+      !! Initializing transf. coeff. with their first guess neutral equivalents :
+      Cd = ztmp0
+      Ce = 1.e-3*( 34.6 * sqrt_Cd_n10 )
+      Ch = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))
+      stab = sqrt_Cd_n10   ! Temporaty array !!! stab == SQRT(Cd)
+
+      !! Initializing values at z_u with z_t values:
+      t_zu = t_zt   ;   q_zu = q_zt
+
+      !!  * Now starting iteration loop
+      DO j_itt=1, nb_itt
+         !
+         ztmp1 = t_zu - sst   ! Updating air/sea differences
+         ztmp2 = q_zu - ssq
+
+         ! Updating turbulent scales :   (L&Y 2004 eq. (7))
+         ztmp1  = Ch/stab*ztmp1    ! theta*   (stab == SQRT(Cd))
+         ztmp2  = Ce/stab*ztmp2    ! q*       (stab == SQRT(Cd))
+
+         ztmp0 = 1. + rctv0*q_zu      ! multiply this with t and you have the virtual temperature
+
+         ! Estimate the inverse of Monin-Obukov length (1/L) at height zu:
+         ztmp0 =  (grav*vkarmn/(t_zu*ztmp0)*(ztmp1*ztmp0 + rctv0*t_zu*ztmp2)) / (Cd*U_blk*U_blk)
+         !                                                      ( Cd*U_blk*U_blk is U*^2 at zu )
+
+         !! Stability parameters :
+         zeta_u   = zu*ztmp0   ;  zeta_u = sign( min(abs(zeta_u),10.0), zeta_u )
+         zpsi_h_u = psi_h( zeta_u )
+
+         !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c))
+         IF( .NOT. l_zt_equal_zu ) THEN
+            !! Array 'stab' is free for the moment so using it to store 'zeta_t'
+            stab = zt*ztmp0 ;  stab = SIGN( MIN(ABS(stab),10.0), stab )  ! Temporaty array stab == zeta_t !!!
+            stab = LOG(zt/zu) + zpsi_h_u - psi_h(stab)                   ! stab just used as temp array again!
+            t_zu = t_zt - ztmp1/vkarmn*stab    ! ztmp1 is still theta*  L&Y 2004 eq.(9b)
+            q_zu = q_zt - ztmp2/vkarmn*stab    ! ztmp2 is still q*      L&Y 2004 eq.(9c)
+            q_zu = max(0., q_zu)
+         END IF
+
+         ztmp2 = psi_m(zeta_u)
+         IF( ln_cdgw ) THEN      ! surface wave case
+            stab = vkarmn / ( vkarmn / sqrt_Cd_n10 - ztmp2 )  ! (stab == SQRT(Cd))
+            Cd      = stab * stab
+         ELSE
+            ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)...
+            !   In very rare low-wind conditions, the old way of estimating the
+            !   neutral wind speed at 10m leads to a negative value that causes the code
+            !   to crash. To prevent this a threshold of 0.25m/s is imposed.
+            ztmp0 = MAX( 0.25 , U_blk/(1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - ztmp2)) ) ! U_n10 (ztmp2 == psi_m(zeta_u))
+            ztmp0 = cd_neutral_10m(ztmp0)                                               ! Cd_n10
+            sqrt_Cd_n10 = sqrt(ztmp0)
+
+            stab    = 0.5 + sign(0.5,zeta_u)                           ! update stability
+            Cx_n10  = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))  ! L&Y 2004 eq. (6c-6d)    (Cx_n10 == Ch_n10)
+
+            !! Update of transfer coefficients:
+            ztmp1 = 1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - ztmp2)   ! L&Y 2004 eq. (10a) (ztmp2 == psi_m(zeta_u))
+            Cd      = ztmp0 / ( ztmp1*ztmp1 )
+            stab = SQRT( Cd ) ! Temporary array !!! (stab == SQRT(Cd))
+         ENDIF
+
+         ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10
+         ztmp2 = stab / sqrt_Cd_n10   ! (stab == SQRT(Cd))
+         ztmp1 = 1. + Cx_n10*ztmp0    ! (Cx_n10 == Ch_n10)
+         Ch  = Cx_n10*ztmp2 / ztmp1   ! L&Y 2004 eq. (10b)
+
+         Cx_n10  = 1.e-3 * (34.6 * sqrt_Cd_n10)  ! L&Y 2004 eq. (6b)    ! Cx_n10 == Ce_n10
+         ztmp1 = 1. + Cx_n10*ztmp0
+         Ce  = Cx_n10*ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
+
+      END DO
+
+      CALL wrk_dealloc( jpi,jpj,   Cx_n10, sqrt_Cd_n10, zeta_u, stab )
+      CALL wrk_dealloc( jpi,jpj,   zpsi_h_u, ztmp0, ztmp1, ztmp2 )
+
+      IF( nn_timing == 1 )   CALL timing_stop('turb_ncar')
+
+   END SUBROUTINE turb_ncar
+
+
+   FUNCTION cd_neutral_10m( pw10 )
+      !!----------------------------------------------------------------------------------      
+      !! Estimate of the neutral drag coefficient at 10m as a function
+      !! of neutral wind  speed at 10m
+      !!
+      !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b)
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pw10           ! scalar wind speed at 10m (m/s)
+      REAL(wp), DIMENSION(jpi,jpj)             :: cd_neutral_10m
+      !
+      INTEGER  ::     ji, jj     ! dummy loop indices
+      REAL(wp) :: zgt33, zw, zw6 ! local scalars
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            !
+            zw  = pw10(ji,jj)
+            zw6 = zw*zw*zw
+            zw6 = zw6*zw6
+            !
+            ! When wind speed > 33 m/s => Cyclone conditions => special treatment
+            zgt33 = 0.5 + SIGN( 0.5, (zw - 33.) )   ! If pw10 < 33. => 0, else => 1
+            !
+            cd_neutral_10m(ji,jj) = 1.e-3 * ( &
+               &       (1. - zgt33)*( 2.7/zw + 0.142 + zw/13.09 - 3.14807E-10*zw6) & ! wind <  33 m/s
+               &      +    zgt33   *      2.34 )                                     ! wind >= 33 m/s
+            !
+            cd_neutral_10m(ji,jj) = MAX(cd_neutral_10m(ji,jj), 1.E-6)
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION cd_neutral_10m
+
+
+   FUNCTION psi_m( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! Universal profile stability function for momentum
+      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
+      !!     
+      !! pzet0 : stability paramenter, z/L where z is altitude measurement                                          
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pzeta
+      REAL(wp), DIMENSION(jpi,jpj)             ::   psi_m
+      !
+      INTEGER  ::   ji, jj         ! dummy loop indices
+      REAL(wp) :: zx2, zx, zstab   ! local scalars
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zx2 = SQRT( ABS( 1. - 16.*pzeta(ji,jj) ) )
+            zx2 = MAX ( zx2 , 1. )
+            zx  = SQRT( zx2 )
+            zstab = 0.5 + SIGN( 0.5 , pzeta(ji,jj) )
+            !
+            psi_m(ji,jj) =        zstab  * (-5.*pzeta(ji,jj))       &          ! Stable
+               &          + (1. - zstab) * (2.*LOG((1. + zx)*0.5)   &          ! Unstable
+               &               + LOG((1. + zx2)*0.5) - 2.*ATAN(zx) + rpi*0.5)  !    "
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_m
+
+
+   FUNCTION psi_h( pzeta )
+      !!----------------------------------------------------------------------------------
+      !! Universal profile stability function for temperature and humidity
+      !!    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
+      !!
+      !! pzet0 : stability paramenter, z/L where z is altitude measurement                                          
+      !!         and L is M-O length
+      !!
+      !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://sourceforge.net/p/aerobulk)
+      !!----------------------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pzeta
+      REAL(wp), DIMENSION(jpi,jpj)             :: psi_h
+      !
+      INTEGER  ::   ji, jj    ! dummy loop indices
+      REAL(wp) :: zx2, zstab  ! local scalars
+      !!----------------------------------------------------------------------------------
+      !
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zx2 = SQRT( ABS( 1. - 16.*pzeta(ji,jj) ) )
+            zx2 = MAX ( zx2 , 1. )
+            zstab = 0.5 + SIGN( 0.5 , pzeta(ji,jj) )
+            !
+            psi_h(ji,jj) =         zstab  * (-5.*pzeta(ji,jj))        &  ! Stable
+               &           + (1. - zstab) * (2.*LOG( (1. + zx2)*0.5 ))   ! Unstable
+            !
+         END DO
+      END DO
+      !
+   END FUNCTION psi_h
+
+   !!======================================================================
+END MODULE sbcblk_algo_ncar
Index: anches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 7279)
+++ 	(revision )
@@ -1,1037 +1,0 @@
-MODULE sbcblk_clio
-   !!======================================================================
-   !!                   ***  MODULE  sbcblk_clio  ***
-   !! Ocean forcing:  bulk thermohaline forcing of the ocean (or ice)
-   !!=====================================================================
-   !! History :  OPA  !  1997-06 (Louvain-La-Neuve)  Original code
-   !!                 !  2001-04 (C. Ethe) add flx_blk_declin
-   !!   NEMO     2.0  !  2002-08 (C. Ethe, G. Madec) F90: Free form and module
-   !!            3.0  !  2008-03 (C. Talandier, G. Madec) surface module + LIM3
-   !!            3.2  !  2009-04 (B. Lemaire) Introduce iom_put
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!   sbc_blk_clio     : CLIO bulk formulation: read and update required input fields
-   !!   blk_clio_oce     : ocean CLIO bulk formulea: compute momentum, heat and freswater fluxes for the ocean
-   !!   blk_ice_clio     : ice   CLIO bulk formulea: compute momentum, heat and freswater fluxes for the sea-ice
-   !!   blk_clio_qsr_oce : shortwave radiation for ocean computed from the cloud cover
-   !!   blk_clio_qsr_ice : shortwave radiation for ice   computed from the cloud cover
-   !!   flx_blk_declin   : solar declination
-   !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and tracers
-   USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants
-   USE fldread        ! read input fields
-   USE sbc_oce        ! Surface boundary condition: ocean fields
-   USE iom            ! I/O manager library
-   USE in_out_manager ! I/O manager
-   USE lib_mpp        ! distribued memory computing library
-   USE wrk_nemo       ! work arrays
-   USE timing         ! Timing
-   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
-
-   USE albedo
-   USE prtctl          ! Print control
-#if defined key_lim3 
-   USE ice
-   USE sbc_ice         ! Surface boundary condition: ice fields
-   USE limthd_dh       ! for CALL lim_thd_snwblow
-#elif defined key_lim2
-   USE ice_2
-   USE sbc_ice         ! Surface boundary condition: ice fields
-   USE par_ice_2       ! Surface boundary condition: ice fields
-#endif
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC sbc_blk_clio        ! routine called by sbcmod.F90 
-#if defined key_lim2 || defined key_lim3
-   PUBLIC blk_ice_clio_tau    ! routine called by sbcice_lim.F90 
-   PUBLIC blk_ice_clio_flx    ! routine called by sbcice_lim.F90 
-#endif
-
-   INTEGER , PARAMETER ::   jpfld   = 7           ! maximum number of files to read 
-   INTEGER , PARAMETER ::   jp_utau = 1           ! index of wind stress (i-component)      (N/m2)    at U-point
-   INTEGER , PARAMETER ::   jp_vtau = 2           ! index of wind stress (j-component)      (N/m2)    at V-point
-   INTEGER , PARAMETER ::   jp_wndm = 3           ! index of 10m wind module                 (m/s)    at T-point
-   INTEGER , PARAMETER ::   jp_humi = 4           ! index of specific humidity               ( % )
-   INTEGER , PARAMETER ::   jp_ccov = 5           ! index of cloud cover                     ( % )
-   INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin)
-   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
-
-   TYPE(FLD),ALLOCATABLE,DIMENSION(:) :: sf  ! structure of input fields (file informations, fields read)
-
-   INTEGER, PARAMETER  ::   jpintsr = 24          ! number of time step between sunrise and sunset
-   !                                              ! uses for heat flux computation
-   LOGICAL ::   lbulk_init = .TRUE.               ! flag, bulk initialization done or not)
-
-   REAL(wp) ::   cai = 1.40e-3 ! best estimate of atm drag in order to get correct FS export in ORCA2-LIM
-   REAL(wp) ::   cao = 1.00e-3 ! chosen by default  ==> should depends on many things...  !!gmto be updated
-
-   REAL(wp) ::   rdtbs2      !:   
-   
-   REAL(wp), DIMENSION(19)  ::  budyko            ! BUDYKO's coefficient (cloudiness effect on LW radiation)
-   DATA budyko / 1.00, 0.98, 0.95, 0.92, 0.89, 0.86, 0.83, 0.80, 0.78, 0.75,   &
-      &          0.72, 0.69, 0.67, 0.64, 0.61, 0.58, 0.56, 0.53, 0.50 /
-   REAL(wp), DIMENSION(20)  :: tauco              ! cloud optical depth coefficient
-   DATA tauco / 6.6, 6.6, 7.0, 7.2, 7.1, 6.8, 6.5, 6.6, 7.1, 7.6,   &
-      &         6.6, 6.1, 5.6, 5.5, 5.8, 5.8, 5.6, 5.6, 5.6, 5.6 /
-   !!
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sbudyko      ! cloudiness effect on LW radiation
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stauc        ! cloud optical depth 
-   
-   REAL(wp) ::   eps20  = 1.e-20   ! constant values
-   
-   !! * Substitutions
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE sbc_blk_clio( kt )
-      !!---------------------------------------------------------------------
-      !!                    ***  ROUTINE sbc_blk_clio  ***
-      !!                   
-      !! ** Purpose :   provide at each time step the surface ocean fluxes
-      !!      (momentum, heat, freshwater and runoff) 
-      !!
-      !! ** Method  : (1) READ each fluxes in NetCDF files:
-      !!      the i-component of the stress                (N/m2)
-      !!      the j-component of the stress                (N/m2)
-      !!      the 10m wind speed module                    (m/s)
-      !!      the 10m air temperature                      (Kelvin)
-      !!      the 10m specific humidity                    (%)
-      !!      the cloud cover                              (%)
-      !!      the total precipitation (rain+snow)          (Kg/m2/s)
-      !!              (2) CALL blk_oce_clio
-      !!
-      !!      C A U T I O N : never mask the surface stress fields
-      !!                      the stress is assumed to be in the (i,j) mesh referential
-      !!
-      !! ** Action  :   defined at each time-step at the air-sea interface
-      !!              - utau, vtau  i- and j-component of the wind stress
-      !!              - taum        wind stress module at T-point
-      !!              - wndm        10m wind module at T-point over free ocean or leads in presence of sea-ice
-      !!              - qns         non-solar heat flux including latent heat of solid 
-      !!                            precip. melting and emp heat content
-      !!              - qsr         solar heat flux
-      !!              - emp         upward mass flux (evap. - precip)
-      !!              - sfx         salt flux; set to zero at nit000 but possibly non-zero
-      !!                            if ice is present (computed in limsbc(_2).F90)
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
-      !!
-      INTEGER  ::   ifpr, jfpr                   ! dummy indices
-      INTEGER  ::   ierr0, ierr1, ierr2, ierr3   ! return error code
-      INTEGER  ::   ios                          ! Local integer output status for namelist read
-      !!
-      CHARACTER(len=100) ::  cn_dir                            !   Root directory for location of CLIO files
-      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                 ! array of namelist informations on the fields to read
-      TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_wndm, sn_tair      ! informations about the fields to be read
-      TYPE(FLD_N) ::   sn_humi, sn_ccov, sn_prec               !   "                                 "
-      !!
-      NAMELIST/namsbc_clio/ cn_dir, sn_utau, sn_vtau, sn_wndm, sn_humi,   &
-         &                          sn_ccov, sn_tair, sn_prec
-      !!---------------------------------------------------------------------
-
-      !                                         ! ====================== !
-      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
-         !                                      ! ====================== !
-
-         REWIND( numnam_ref )              ! Namelist namsbc_clio in reference namelist : CLIO files
-         READ  ( numnam_ref, namsbc_clio, IOSTAT = ios, ERR = 901)
-901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in reference namelist', lwp )
-
-         REWIND( numnam_cfg )              ! Namelist namsbc_clio in configuration namelist : CLIO files
-         READ  ( numnam_cfg, namsbc_clio, IOSTAT = ios, ERR = 902 )
-902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in configuration namelist', lwp )
-         IF(lwm) WRITE ( numond, namsbc_clio )
-
-         ! store namelist information in an array
-         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau   ;   slf_i(jp_wndm) = sn_wndm
-         slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi
-         slf_i(jp_ccov) = sn_ccov   ;   slf_i(jp_prec) = sn_prec
-         
-         ! set sf structure
-         ALLOCATE( sf(jpfld), STAT=ierr0 )
-         IF( ierr0 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf structure' )
-         DO ifpr= 1, jpfld
-            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) , STAT=ierr1)
-            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) , STAT=ierr2 )
-         END DO
-         IF( ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf array structure' )
-         ! fill sf with slf_i and control print
-         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_clio', 'flux formulation for ocean surface boundary condition', 'namsbc_clio' )
-         
-         ! allocate sbcblk clio arrays
-         ALLOCATE( sbudyko(jpi,jpj) , stauc(jpi,jpj), STAT=ierr3 )
-         IF( ierr3 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate arrays' )
-         !
-         sfx(:,:) = 0._wp                       ! salt flux; zero unless ice is present (computed in limsbc(_2).F90)
-         !
-      ENDIF
-      !                                         ! ====================== !
-      !                                         !    At each time-step   !
-      !                                         ! ====================== !
-      !
-      CALL fld_read( kt, nn_fsbc, sf )                ! input fields provided at the current time-step
-      !
-      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_clio( sf, sst_m )
-      !
-   END SUBROUTINE sbc_blk_clio
-
-
-   SUBROUTINE blk_oce_clio( sf, pst )
-      !!---------------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_oce_clio  ***
-      !!                 
-      !!  ** Purpose :   Compute momentum, heat and freshwater fluxes at ocean surface
-      !!               using CLIO bulk formulea
-      !!         
-      !!  ** Method  :   The flux of heat at the ocean surfaces are derived
-      !!       from semi-empirical ( or bulk ) formulae which relate the flux to 
-      !!       the properties of the surface and of the lower atmosphere. Here, we
-      !!       follow the work of Oberhuber, 1988   
-      !!               - momentum flux (stresses) directly read in files at U- and V-points
-      !!               - compute ocean/ice albedos (call albedo_oce/albedo_ice)  
-      !!               - compute shortwave radiation for ocean (call blk_clio_qsr_oce)
-      !!               - compute long-wave radiation for the ocean
-      !!               - compute the turbulent heat fluxes over the ocean
-      !!               - deduce the evaporation over the ocean
-      !!  ** Action  :   Fluxes over the ocean:
-      !!               - utau, vtau  i- and j-component of the wind stress
-      !!               - taum        wind stress module at T-point
-      !!               - wndm        10m wind module at T-point over free ocean or leads in presence of sea-ice
-      !!               - qns         non-solar heat flux including latent heat of solid 
-      !!                             precip. melting and emp heat content
-      !!               - qsr         solar heat flux
-      !!               - emp         suface mass flux (evap.-precip.)
-      !!  ** Nota    :   sf has to be a dummy argument for AGRIF on NEC
-      !!----------------------------------------------------------------------
-      TYPE(fld), INTENT(in), DIMENSION(:)       ::   sf    ! input data
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celsius]
-      !!
-      INTEGER  ::   ji, jj   ! dummy loop indices
-      !!
-      REAL(wp) ::   zrhova, zcsho, zcleo, zcldeff               ! temporary scalars
-      REAL(wp) ::   zqsato, zdteta, zdeltaq, ztvmoy, zobouks    !    -         -
-      REAL(wp) ::   zpsims, zpsihs, zpsils, zobouku, zxins, zpsimu   !    -         -
-      REAL(wp) ::   zpsihu, zpsilu, zstab,zpsim, zpsih, zpsil   !    -         -
-      REAL(wp) ::   zvatmg, zcmn, zchn, zcln, zcmcmn, zdenum    !    -         -
-      REAL(wp) ::   zdtetar, ztvmoyr, zlxins, zchcm, zclcm      !    -         -
-      REAL(wp) ::   zmt1, zmt2, zmt3, ztatm3, ztamr, ztaevbk    !    -         -
-      REAL(wp) ::   zsst, ztatm, zcco1, zpatm, zcmax, zrmax     !    -         -
-      REAL(wp) ::   zrhoa, zev, zes, zeso, zqatm, zevsqr        !    -         -
-      REAL(wp) ::   ztx2, zty2, zcevap, zcprec                  !    -         -
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zqlw        ! long-wave heat flux over ocean
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zqla        ! latent heat flux over ocean
-      REAL(wp), POINTER, DIMENSION(:,:) ::   zqsb        ! sensible heat flux over ocean
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_oce_clio')
-      !
-      CALL wrk_alloc( jpi,jpj, zqlw, zqla, zqsb )
-
-      zpatm = 101000._wp      ! atmospheric pressure  (assumed constant here)
-
-      !------------------------------------!
-      !   momentum fluxes  (utau, vtau )   !
-      !------------------------------------!
-      utau(:,:) = sf(jp_utau)%fnow(:,:,1)
-      vtau(:,:) = sf(jp_vtau)%fnow(:,:,1)
-
-      !------------------------------------!
-      !   wind stress module (taum )       !
-      !------------------------------------!
-      DO jj = 2, jpjm1
-         DO ji = fs_2, fs_jpim1   ! vector opt.
-            ztx2 = utau(ji-1,jj  ) + utau(ji,jj)
-            zty2 = vtau(ji  ,jj-1) + vtau(ji,jj)
-            taum(ji,jj) = 0.5 * SQRT( ztx2 * ztx2 + zty2 * zty2 )
-         END DO
-      END DO
-      utau(:,:) = utau(:,:) * umask(:,:,1)
-      vtau(:,:) = vtau(:,:) * vmask(:,:,1)
-      taum(:,:) = taum(:,:) * tmask(:,:,1)
-      CALL lbc_lnk( taum, 'T', 1. )
-
-      !------------------------------------!
-      !   store the wind speed  (wndm )    !
-      !------------------------------------!
-      wndm(:,:) = sf(jp_wndm)%fnow(:,:,1)
-      wndm(:,:) = wndm(:,:) * tmask(:,:,1)
-
-      !------------------------------------------------!
-      !   Shortwave radiation for ocean and snow/ice   !
-      !------------------------------------------------!
-      
-      CALL blk_clio_qsr_oce( qsr )
-      qsr(:,:) = qsr(:,:) * tmask(:,:,1) ! no shortwave radiation into the ocean beneath ice shelf
-      !------------------------!
-      !   Other ocean fluxes   !
-      !------------------------!
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            !
-            zsst  = pst(ji,jj)              + rt0           ! converte Celsius to Kelvin the SST
-            ztatm = sf(jp_tair)%fnow(ji,jj,1)               ! and set minimum value far above 0 K (=rt0 over land)
-            zcco1 = 1.0 - sf(jp_ccov)%fnow(ji,jj,1)         ! fraction of clear sky ( 1 - cloud cover)
-            zrhoa = zpatm / ( 287.04 * ztatm )              ! air density (equation of state for dry air) 
-            ztamr = ztatm - rtt                             ! Saturation water vapour
-            zmt1  = SIGN( 17.269,  ztamr )                  !           ||
-            zmt2  = SIGN( 21.875,  ztamr )                  !          \  /
-            zmt3  = SIGN( 28.200, -ztamr )                  !           \/
-            zes   = 611.0 * EXP(  ABS( ztamr ) * MIN ( zmt1, zmt2 ) / ( ztatm - 35.86  + MAX( 0.e0, zmt3 ) )  )
-            zev    = sf(jp_humi)%fnow(ji,jj,1) * zes        ! vapour pressure  
-            zevsqr = SQRT( zev * 0.01 )                     ! square-root of vapour pressure
-            zqatm = 0.622 * zev / ( zpatm - 0.378 * zev )   ! specific humidity 
-
-            !--------------------------------------!
-            !  long-wave radiation over the ocean  !  ( Berliand 1952 ; all latitudes )
-            !--------------------------------------!
-            ztatm3  = ztatm * ztatm * ztatm
-            zcldeff = 1.0 - sbudyko(ji,jj) * sf(jp_ccov)%fnow(ji,jj,1) * sf(jp_ccov)%fnow(ji,jj,1)    
-            ztaevbk = ztatm * ztatm3 * zcldeff * ( 0.39 - 0.05 * zevsqr ) 
-            !
-            zqlw(ji,jj) = - emic * stefan * ( ztaevbk + 4. * ztatm3 * ( zsst - ztatm ) ) 
-
-            !--------------------------------------------------
-            !  Latent and sensible heat fluxes over the ocean 
-            !--------------------------------------------------
-            !                                                          ! vapour pressure at saturation of ocean
-            zeso =  611.0 * EXP ( 17.2693884 * ( zsst - rtt ) * tmask(ji,jj,1) / ( zsst - 35.86 ) )
-
-            zqsato = ( 0.622 * zeso ) / ( zpatm - 0.378 * zeso )       ! humidity close to the ocean surface (at saturation)
-
-            ! Drag coefficients from Large and Pond (1981,1982)
-            !                                                          ! Stability parameters
-            zdteta  = zsst - ztatm
-            zdeltaq = zqatm - zqsato
-            ztvmoy  = ztatm * ( 1. + 2.2e-3 * ztatm * zqatm )
-            zdenum  = MAX( sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) * ztvmoy, eps20 )
-            zdtetar = zdteta / zdenum
-            ztvmoyr = ztvmoy * ztvmoy * zdeltaq / zdenum
-            !                                                          ! case of stable atmospheric conditions
-            zobouks = -70.0 * 10. * ( zdtetar + 3.2e-3 * ztvmoyr )
-            zobouks = MAX( 0.e0, zobouks )
-            zpsims = -7.0 * zobouks
-            zpsihs =  zpsims
-            zpsils =  zpsims
-            !                                                          ! case of unstable atmospheric conditions
-            zobouku = MIN(  0.e0, -100.0 * 10.0 * ( zdtetar + 2.2e-3 * ztvmoyr )  )
-            zxins   = ( 1. - 16. * zobouku )**0.25
-            zlxins  = LOG( ( 1. + zxins * zxins ) / 2. )
-            zpsimu  = 2. * LOG( ( 1 + zxins ) * 0.5 )  + zlxins - 2. * ATAN( zxins ) + rpi * 0.5
-            zpsihu  = 2. * zlxins
-            zpsilu  = zpsihu
-            !                                                          ! intermediate values
-            zstab   = MAX( 0.e0, SIGN( 1.e0, zdteta ) )
-            zpsim   = zstab * zpsimu + ( 1.0 - zstab ) * zpsims
-            zpsih   = zstab * zpsihu + ( 1.0 - zstab ) * zpsihs
-            zpsil   = zpsih
-            
-            zvatmg         = MAX( 0.032 * 1.5e-3 * sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) / grav, eps20 )
-            zcmn           = vkarmn / LOG ( 10. / zvatmg )
-            zchn           = 0.0327 * zcmn
-            zcln           = 0.0346 * zcmn
-            zcmcmn         = 1. / ( 1. - zcmn * zpsim / vkarmn )
-            ! sometimes the ratio zchn * zpsih / ( vkarmn * zcmn ) is too close to 1 and zchcm becomes very very big
-            zcmax = 0.1               ! choice for maximum value of the heat transfer coefficient, guided by my intuition
-            zrmax = 1 - 3.e-4 / zcmax ! maximum value of the ratio
-            zchcm = zcmcmn / ( 1. - MIN ( zchn * zpsih / ( vkarmn * zcmn ) , zrmax ) )
-            zclcm          = zchcm
-            !                                                          ! transfert coef. (Large and Pond 1981,1982)
-            zcsho          = zchn * zchcm                                
-            zcleo          = zcln * zclcm 
-
-            zrhova         = zrhoa * sf(jp_wndm)%fnow(ji,jj,1)
-
-            ! sensible heat flux
-            zqsb(ji,jj) = zrhova * zcsho * 1004.0  * ( zsst - ztatm )  
-         
-            ! latent heat flux (bounded by zero)
-            zqla(ji,jj) = MAX(  0.e0, zrhova * zcleo * 2.5e+06 * ( zqsato - zqatm )  )
-            !               
-         END DO
-      END DO
-      
-      ! ----------------------------------------------------------------------------- !
-      !     III    Total FLUXES                                                       !
-      ! ----------------------------------------------------------------------------- !
-      zcevap = rcp /  cevap    ! convert zqla ==> evap (Kg/m2/s) ==> m/s ==> W/m2
-      zcprec = rcp /  rday     ! convert prec ( mm/day ==> m/s)  ==> W/m2
-
-      emp(:,:) = zqla(:,:) / cevap                                        &   ! freshwater flux
-         &     - sf(jp_prec)%fnow(:,:,1) / rday * tmask(:,:,1)
-      !
-      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                        &   ! Downward Non Solar flux
-         &     - zqla(:,:)             * pst(:,:) * zcevap                &   ! remove evap.   heat content at SST in Celsius
-         &     + sf(jp_prec)%fnow(:,:,1) * sf(jp_tair)%fnow(:,:,1) * zcprec   ! add    precip. heat content at Tair in Celsius
-      qns(:,:) = qns(:,:) * tmask(:,:,1)
-#if defined key_lim3
-      qns_oce(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)
-      qsr_oce(:,:) = qsr(:,:)
-#endif
-      ! NB: if sea-ice model, the snow precip are computed and the associated heat is added to qns (see blk_ice_clio)
-
-      IF ( nn_ice == 0 ) THEN
-         CALL iom_put( "qlw_oce" ,   zqlw )                 ! output downward longwave  heat over the ocean
-         CALL iom_put( "qsb_oce" , - zqsb )                 ! output downward sensible  heat over the ocean
-         CALL iom_put( "qla_oce" , - zqla )                 ! output downward latent    heat over the ocean
-         CALL iom_put( "qemp_oce",   qns-zqlw+zqsb+zqla )   ! output downward heat content of E-P over the ocean
-         CALL iom_put( "qns_oce" ,   qns  )                 ! output downward non solar heat over the ocean
-         CALL iom_put( "qsr_oce" ,   qsr  )                 ! output downward solar heat over the ocean
-         CALL iom_put( "qt_oce"  ,   qns+qsr )              ! output total downward heat over the ocean
-      ENDIF
-
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce_clio: zqsb   : ', tab2d_2=zqlw , clinfo2=' zqlw  : ')
-         CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce_clio: zqla   : ', tab2d_2=qsr  , clinfo2=' qsr   : ')
-         CALL prt_ctl(tab2d_1=pst  , clinfo1=' blk_oce_clio: pst    : ', tab2d_2=emp  , clinfo2=' emp   : ')
-         CALL prt_ctl(tab2d_1=utau , clinfo1=' blk_oce_clio: utau   : ', mask1=umask,   &
-            &         tab2d_2=vtau , clinfo2=' vtau : ', mask2=vmask )
-      ENDIF
-
-      CALL wrk_dealloc( jpi,jpj, zqlw, zqla, zqsb )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_oce_clio')
-      !
-   END SUBROUTINE blk_oce_clio
-
-# if defined key_lim2 || defined key_lim3
-
-   SUBROUTINE blk_ice_clio_tau
-      !!---------------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_ice_clio_tau  ***
-      !!                 
-      !!  ** Purpose :   Computation momentum flux at the ice-atm interface  
-      !!         
-      !!  ** Method  :   Read utau from a forcing file. Rearrange if C-grid
-      !!
-      !!----------------------------------------------------------------------
-      REAL(wp) ::   zcoef
-      INTEGER  ::   ji, jj   ! dummy loop indices
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_ice_clio_tau')
-      !
-      SELECT CASE( cp_ice_msh )
-      !
-      CASE( 'C' )                          ! C-grid ice dynamics
-         !
-         zcoef  = cai / cao                         ! Change from air-sea stress to air-ice stress
-         utau_ice(:,:) = zcoef * utau(:,:)
-         vtau_ice(:,:) = zcoef * vtau(:,:)
-         !
-      CASE( 'I' )                          ! I-grid ice dynamics:  I-point (i.e. F-point lower-left corner)
-         !
-         zcoef  = 0.5_wp * cai / cao                ! Change from air-sea stress to air-ice stress
-         DO jj = 2, jpj         ! stress from ocean U- and V-points to ice U,V point
-            DO ji = 2, jpi   ! I-grid : no vector opt.
-               utau_ice(ji,jj) = zcoef * ( utau(ji-1,jj  ) + utau(ji-1,jj-1) )
-               vtau_ice(ji,jj) = zcoef * ( vtau(ji  ,jj-1) + vtau(ji-1,jj-1) )
-            END DO
-         END DO
-         !
-         CALL lbc_lnk( utau_ice(:,:), 'I', -1. )   ;   CALL lbc_lnk( vtau_ice(:,:), 'I', -1. )   ! I-point
-         !
-      END SELECT
-      !
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab2d_1=utau_ice , clinfo1=' blk_ice_clio: utau_ice : ', tab2d_2=vtau_ice , clinfo2=' vtau_ice : ')
-      ENDIF
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_clio_tau')
-      !
-   END SUBROUTINE blk_ice_clio_tau
-   
-#endif
-
-# if defined key_lim2 || defined key_lim3
-
-   SUBROUTINE blk_ice_clio_flx(  ptsu , palb_cs, palb_os, palb )
-      !!---------------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_ice_clio_flx ***
-      !!                 
-      !!  ** Purpose :   Computation of the heat fluxes at ocean and snow/ice
-      !!       surface the solar heat at ocean and snow/ice surfaces and the 
-      !!       sensitivity of total heat fluxes to the SST variations
-      !!         
-      !!  ** Method  :   The flux of heat at the ice and ocean surfaces are derived
-      !!       from semi-empirical ( or bulk ) formulae which relate the flux to 
-      !!       the properties of the surface and of the lower atmosphere. Here, we
-      !!       follow the work of Oberhuber, 1988   
-      !!
-      !!  ** Action  :   call albedo_oce/albedo_ice to compute ocean/ice albedo 
-      !!               - snow precipitation
-      !!               - solar flux at the ocean and ice surfaces
-      !!               - the long-wave radiation for the ocean and sea/ice
-      !!               - turbulent heat fluxes over water and ice
-      !!               - evaporation over water
-      !!               - total heat fluxes sensitivity over ice (dQ/dT)
-      !!               - latent heat flux sensitivity over ice (dQla/dT)
-      !!               - qns  :  modified the non solar heat flux over the ocean
-      !!                         to take into account solid precip latent heat flux
-      !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   ptsu      ! ice surface temperature                   [Kelvin]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   palb_cs  ! ice albedo (clear    sky) (alb_ice_cs)         [-]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   palb_os  ! ice albedo (overcast sky) (alb_ice_os)         [-]
-      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   palb     ! ice albedo (actual value)                      [-]
-      !!
-      INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      !!
-      REAL(wp) ::   zmt1, zmt2, zmt3, ztatm3                    ! temporary scalars
-      REAL(wp) ::   ztaevbk, zind1, zind2, zind3, ztamr         !    -         -
-      REAL(wp) ::   zesi, zqsati, zdesidt                       !    -         -
-      REAL(wp) ::   zdqla, zcldeff, zev, zes, zpatm, zrhova     !    -         -
-      REAL(wp) ::   zcshi, zclei, zrhovaclei, zrhovacshi        !    -         -
-      REAL(wp) ::   ztice3, zticemb, zticemb2, zdqlw, zdqsb     !    -         -
-      REAL(wp) ::   z1_lsub                                     !    -         -
-      !!
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   ztatm   ! Tair in Kelvin
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   zqatm   ! specific humidity
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   zevsqr  ! vapour pressure square-root
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   zrhoa   ! air density
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qlw, z_qsb
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   zevap, zsnw
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_ice_clio_flx')
-      !
-      CALL wrk_alloc( jpi,jpj, ztatm, zqatm, zevsqr, zrhoa )
-      CALL wrk_alloc( jpi,jpj, jpl, z_qlw, z_qsb )
-
-      zpatm = 101000.                        ! atmospheric pressure  (assumed constant  here)
-      !--------------------------------------------------------------------------------
-      !  Determine cloud optical depths as a function of latitude (Chou et al., 1981).
-      !  and the correction factor for taking into account  the effect of clouds 
-      !--------------------------------------------------------------------------------
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            ztatm (ji,jj) = sf(jp_tair)%fnow(ji,jj,1)                ! air temperature in Kelvins 
-      
-            zrhoa(ji,jj) = zpatm / ( 287.04 * ztatm(ji,jj) )         ! air density (equation of state for dry air) 
-      
-            ztamr = ztatm(ji,jj) - rtt                               ! Saturation water vapour
-            zmt1  = SIGN( 17.269,  ztamr )
-            zmt2  = SIGN( 21.875,  ztamr )
-            zmt3  = SIGN( 28.200, -ztamr )
-            zes   = 611.0 * EXP(  ABS( ztamr ) * MIN ( zmt1, zmt2 )   &
-               &                / ( ztatm(ji,jj) - 35.86  + MAX( 0.e0, zmt3 ) )  )
-
-            zev = sf(jp_humi)%fnow(ji,jj,1) * zes                    ! vapour pressure  
-            zevsqr(ji,jj) = SQRT( zev * 0.01 )                       ! square-root of vapour pressure
-            zqatm(ji,jj) = 0.622 * zev / ( zpatm - 0.378 * zev )     ! specific humidity 
-
-            !----------------------------------------------------
-            !   Computation of snow precipitation (Ledley, 1985) |
-            !----------------------------------------------------
-            zmt1  =   253.0 - ztatm(ji,jj)            ;   zind1 = MAX( 0.e0, SIGN( 1.e0, zmt1 ) )
-            zmt2  = ( 272.0 - ztatm(ji,jj) ) / 38.0   ;   zind2 = MAX( 0.e0, SIGN( 1.e0, zmt2 ) )
-            zmt3  = ( 281.0 - ztatm(ji,jj) ) / 18.0   ;   zind3 = MAX( 0.e0, SIGN( 1.e0, zmt3 ) )
-            sprecip(ji,jj) = sf(jp_prec)%fnow(ji,jj,1) / rday   &      ! rday = converte mm/day to kg/m2/s
-               &         * (          zind1      &                   ! solid  (snow) precipitation [kg/m2/s]
-               &            + ( 1.0 - zind1 ) * (          zind2   * ( 0.5 + zmt2 )   &
-               &                                 + ( 1.0 - zind2 ) *  zind3 * zmt3  )   ) 
-
-            !----------------------------------------------------!
-            !  fraction of net penetrative shortwave radiation   !
-            !----------------------------------------------------!
-            ! fraction of qsr_ice which is NOT absorbed in the thin surface layer
-            ! and thus which penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
-            fr1_i0(ji,jj) = 0.18  * ( 1.e0 - sf(jp_ccov)%fnow(ji,jj,1) ) + 0.35 * sf(jp_ccov)%fnow(ji,jj,1) 
-            fr2_i0(ji,jj) = 0.82  * ( 1.e0 - sf(jp_ccov)%fnow(ji,jj,1) ) + 0.65 * sf(jp_ccov)%fnow(ji,jj,1)
-         END DO
-      END DO
-      CALL iom_put( 'snowpre', sprecip )   ! Snow precipitation 
-      
-      !-----------------------------------------------------------!
-      !  snow/ice Shortwave radiation   (abedo already computed)  !
-      !-----------------------------------------------------------!
-      CALL blk_clio_qsr_ice( palb_cs, palb_os, qsr_ice )
-      
-      DO jl = 1, jpl
-         palb(:,:,jl) = ( palb_cs(:,:,jl) * ( 1.e0 - sf(jp_ccov)%fnow(:,:,1) )   &
-            &         +   palb_os(:,:,jl) * sf(jp_ccov)%fnow(:,:,1) )
-      END DO
-
-      !                                     ! ========================== !
-      DO jl = 1, jpl                        !  Loop over ice categories  !
-         !                                  ! ========================== !
-         DO jj = 1 , jpj
-            DO ji = 1, jpi
-               !-------------------------------------------!
-               !  long-wave radiation over ice categories  !  ( Berliand 1952 ; all latitudes )
-               !-------------------------------------------!
-               ztatm3  = ztatm(ji,jj) * ztatm(ji,jj) * ztatm(ji,jj)
-               zcldeff = 1.0 - sbudyko(ji,jj) * sf(jp_ccov)%fnow(ji,jj,1) * sf(jp_ccov)%fnow(ji,jj,1)    
-               ztaevbk = ztatm3 * ztatm(ji,jj) * zcldeff * ( 0.39 - 0.05 * zevsqr(ji,jj) ) 
-               !
-               z_qlw(ji,jj,jl) = - emic * stefan * ( ztaevbk + 4. * ztatm3 * ( ptsu(ji,jj,jl) - ztatm(ji,jj) ) ) 
-
-               !----------------------------------------
-               !  Turbulent heat fluxes over snow/ice     ( Latent and sensible ) 
-               !----------------------------------------        
-
-               ! vapour pressure at saturation of ice (tmask to avoid overflow in the exponential)
-               zesi =  611.0 * EXP( 21.8745587 * tmask(ji,jj,1) * ( ptsu(ji,jj,jl) - rtt )/ ( ptsu(ji,jj,jl) - 7.66 ) )
-               ! humidity close to the ice surface (at saturation)
-               zqsati   = ( 0.622 * zesi ) / ( zpatm - 0.378 * zesi )
-               
-               !  computation of intermediate values
-               zticemb  = ptsu(ji,jj,jl) - 7.66
-               zticemb2 = zticemb * zticemb  
-               ztice3   = ptsu(ji,jj,jl) * ptsu(ji,jj,jl) * ptsu(ji,jj,jl)
-               zdesidt  = zesi * ( 9.5 * LOG( 10.0 ) * ( rtt - 7.66 )  / zticemb2 )
-               
-               !  Transfer cofficients assumed to be constant (Parkinson 1979 ; Maykut 1982)
-               zcshi    = 1.75e-03
-               zclei    = zcshi
-               
-               !  sensible and latent fluxes over ice
-               zrhova     = zrhoa(ji,jj) * sf(jp_wndm)%fnow(ji,jj,1)      ! computation of intermediate values
-               zrhovaclei = zrhova * zcshi * 2.834e+06
-               zrhovacshi = zrhova * zclei * 1004.0
-            
-               !  sensible heat flux
-               z_qsb(ji,jj,jl) = zrhovacshi * ( ptsu(ji,jj,jl) - ztatm(ji,jj) )
-            
-               !  latent heat flux 
-               qla_ice(ji,jj,jl) = MAX(  0.e0, zrhovaclei * ( zqsati - zqatm(ji,jj) )  )
-              
-               !  sensitivity of non solar fluxes (dQ/dT) (long-wave, sensible and latent fluxes)
-               zdqlw = 4.0 * emic * stefan * ztice3
-               zdqsb = zrhovacshi
-               zdqla = zrhovaclei * ( zdesidt * ( zqsati * zqsati / ( zesi * zesi ) ) * ( zpatm / 0.622 ) )   
-               !
-               dqla_ice(ji,jj,jl) = zdqla                           ! latent flux sensitivity
-               dqns_ice(ji,jj,jl) = -( zdqlw + zdqsb + zdqla )      !  total non solar sensitivity
-            END DO
-            !
-         END DO
-         !
-      END DO
-      !
-      ! ----------------------------------------------------------------------------- !
-      !    Total FLUXES                                                               !
-      ! ----------------------------------------------------------------------------- !
-      !
-      qns_ice(:,:,:) = z_qlw (:,:,:) - z_qsb (:,:,:) - qla_ice (:,:,:)      ! Downward Non Solar flux
-      tprecip(:,:)   = sf(jp_prec)%fnow(:,:,1) / rday                     ! total precipitation [kg/m2/s]
-      !
-      ! ----------------------------------------------------------------------------- !
-      !    Correct the OCEAN non solar flux with the existence of solid precipitation !
-      ! ---------------=====--------------------------------------------------------- !
-      qns(:,:) = qns(:,:)                                                           &   ! update the non-solar heat flux with:
-         &     - sprecip(:,:) * lfus                                                  &   ! remove melting solid precip
-         &     + sprecip(:,:) * MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow - rt0 ) * cpic &   ! add solid P at least below melting
-         &     - sprecip(:,:) * sf(jp_tair)%fnow(:,:,1)                        * rcp      ! remove solid precip. at Tair
-
-#if defined key_lim3
-      ! ----------------------------------------------------------------------------- !
-      !    Distribute evapo, precip & associated heat over ice and ocean
-      ! ---------------=====--------------------------------------------------------- !
-      CALL wrk_alloc( jpi,jpj, zevap, zsnw ) 
-
-      ! --- evaporation --- !
-      z1_lsub = 1._wp / Lsub
-      evap_ice (:,:,:) = qla_ice (:,:,:) * z1_lsub ! sublimation
-      devap_ice(:,:,:) = dqla_ice(:,:,:) * z1_lsub
-      zevap    (:,:)   = emp(:,:) + tprecip(:,:)   ! evaporation over ocean
-
-      ! --- evaporation minus precipitation --- !
-      zsnw(:,:) = 0._wp
-      CALL lim_thd_snwblow( pfrld, zsnw )          ! snow redistribution by wind
-      emp_oce(:,:) = pfrld(:,:) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * ( 1._wp - zsnw )
-      emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw
-      emp_tot(:,:) = emp_oce(:,:) + emp_ice(:,:)
-
-      ! --- heat flux associated with emp --- !
-      qemp_oce(:,:) = - pfrld(:,:) * zevap(:,:) * sst_m(:,:) * rcp                               & ! evap
-         &          + ( tprecip(:,:) - sprecip(:,:) ) * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp  & ! liquid precip
-         &          +   sprecip(:,:) * ( 1._wp - zsnw ) *                                        & ! solid precip
-         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-      qemp_ice(:,:) =   sprecip(:,:) * zsnw *                                                    & ! solid precip (only)
-         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-
-      ! --- total solar and non solar fluxes --- !
-      qns_tot(:,:) = pfrld(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
-      qsr_tot(:,:) = pfrld(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
-
-      ! --- heat content of precip over ice in J/m3 (to be used in 1D-thermo) --- !
-      qprec_ice(:,:) = rhosn * ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-
-      ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- !
-      DO jl = 1, jpl
-         qevap_ice(:,:,jl) = 0._wp ! should be -evap_ice(:,:,jl)*( ( Tice - rt0 ) * cpic * tmask(:,:,1) - lfus )
-                                   ! but then qemp_ice should also include sublimation 
-      END DO
-
-      CALL wrk_dealloc( jpi,jpj, zevap, zsnw ) 
-#endif
-
-!!gm : not necessary as all input data are lbc_lnk...
-      CALL lbc_lnk( fr1_i0  (:,:) , 'T', 1. )
-      CALL lbc_lnk( fr2_i0  (:,:) , 'T', 1. )
-      DO jl = 1, jpl
-         CALL lbc_lnk( qns_ice (:,:,jl) , 'T', 1. )
-         CALL lbc_lnk( dqns_ice(:,:,jl) , 'T', 1. )
-         CALL lbc_lnk( qla_ice (:,:,jl) , 'T', 1. )
-         CALL lbc_lnk( dqla_ice(:,:,jl) , 'T', 1. )
-      END DO
-
-!!gm : mask is not required on forcing
-      DO jl = 1, jpl
-         qns_ice (:,:,jl) = qns_ice (:,:,jl) * tmask(:,:,1)
-         qla_ice (:,:,jl) = qla_ice (:,:,jl) * tmask(:,:,1)
-         dqns_ice(:,:,jl) = dqns_ice(:,:,jl) * tmask(:,:,1)
-         dqla_ice(:,:,jl) = dqla_ice(:,:,jl) * tmask(:,:,1)
-      END DO
-
-      CALL wrk_dealloc( jpi,jpj, ztatm, zqatm, zevsqr, zrhoa )
-      CALL wrk_dealloc( jpi,jpj, jpl  , z_qlw, z_qsb )
-
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab3d_1=z_qsb  , clinfo1=' blk_ice_clio: z_qsb  : ', tab3d_2=z_qlw  , clinfo2=' z_qlw  : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=qla_ice  , clinfo1=' blk_ice_clio: z_qla  : ', tab3d_2=qsr_ice  , clinfo2=' qsr_ice  : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=dqns_ice , clinfo1=' blk_ice_clio: dqns_ice : ', tab3d_2=qns_ice  , clinfo2=' qns_ice  : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=dqla_ice , clinfo1=' blk_ice_clio: dqla_ice : ', tab3d_2=ptsu    , clinfo2=' ptsu    : ', kdim=jpl)
-         CALL prt_ctl(tab2d_1=tprecip  , clinfo1=' blk_ice_clio: tprecip  : ', tab2d_2=sprecip  , clinfo2=' sprecip  : ')
-      ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_clio_flx')
-      !
-   END SUBROUTINE blk_ice_clio_flx
-
-#endif
-
-   SUBROUTINE blk_clio_qsr_oce( pqsr_oce )
-      !!---------------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_clio_qsr_oce  ***
-      !!                 
-      !!  ** Purpose :   Computation of the shortwave radiation at the ocean and the
-      !!               snow/ice surfaces. 
-      !!         
-      !!  ** Method  : - computed qsr from the cloud cover for both ice and ocean 
-      !!               - also initialise sbudyko and stauc once for all 
-      !!----------------------------------------------------------------------
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)     ::   pqsr_oce    ! shortwave radiation  over the ocean
-      !!
-      INTEGER, PARAMETER  ::   jp24 = 24   ! sampling of the daylight period (sunrise to sunset) into 24 equal parts
-      !!      
-      INTEGER  ::   ji, jj, jt    ! dummy loop indices 
-      INTEGER  ::   indaet            !  = -1, 0, 1 for odd, normal and leap years resp.
-      INTEGER  ::   iday              ! integer part of day
-      INTEGER  ::   indxb, indxc      ! index for cloud depth coefficient
-
-      REAL(wp)  ::   zalat , zclat, zcmue, zcmue2    ! local scalars 
-      REAL(wp)  ::   zmt1, zmt2, zmt3                ! 
-      REAL(wp)  ::   zdecl, zsdecl , zcdecl          ! 
-      REAL(wp)  ::   za_oce, ztamr                   !
-
-      REAL(wp) ::   zdl, zlha                        ! local scalars
-      REAL(wp) ::   zlmunoon, zcldcor, zdaycor       !   
-      REAL(wp) ::   zxday, zdist, zcoef, zcoef1      !
-      REAL(wp) ::   zes
-      
-      REAL(wp), DIMENSION(:,:), POINTER ::   zev          ! vapour pressure
-      REAL(wp), DIMENSION(:,:), POINTER ::   zdlha, zlsrise, zlsset     ! 2D workspace
-      REAL(wp), DIMENSION(:,:), POINTER ::   zps, zpc   ! sine (cosine) of latitude per sine (cosine) of solar declination 
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_clio_qsr_oce')
-      !
-      CALL wrk_alloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
-
-      IF( lbulk_init ) THEN             !   Initilization at first time step only
-         rdtbs2 = nn_fsbc * rdt * 0.5
-         ! cloud optical depths as a function of latitude (Chou et al., 1981).
-         ! and the correction factor for taking into account  the effect of clouds 
-         DO jj = 1, jpj
-            DO ji = 1 , jpi
-               zalat          = ( 90.e0 - ABS( gphit(ji,jj) ) ) /  5.e0
-               zclat          = ( 95.e0 -      gphit(ji,jj)   ) / 10.e0
-               indxb          = 1 + INT( zalat )
-               indxc          = 1 + INT( zclat )
-               zdl            = zclat - INT( zclat )
-               !  correction factor to account for the effect of clouds
-               sbudyko(ji,jj) = budyko(indxb)
-               stauc  (ji,jj) = ( 1.e0 - zdl ) * tauco( indxc ) + zdl * tauco( indxc + 1 )
-            END DO
-         END DO
-         lbulk_init = .FALSE.
-      ENDIF
-
-
-      ! Saturated water vapour and vapour pressure
-      ! ------------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            ztamr = sf(jp_tair)%fnow(ji,jj,1) - rtt
-            zmt1  = SIGN( 17.269,  ztamr )
-            zmt2  = SIGN( 21.875,  ztamr )
-            zmt3  = SIGN( 28.200, -ztamr )
-            zes = 611.0 * EXP(  ABS( ztamr ) * MIN ( zmt1, zmt2 )   &              ! Saturation water vapour
-               &                     / ( sf(jp_tair)%fnow(ji,jj,1) - 35.86  + MAX( 0.e0, zmt3 ) )  )
-            zev(ji,jj) = sf(jp_humi)%fnow(ji,jj,1) * zes * 1.0e-05                 ! vapour pressure  
-         END DO
-      END DO
-
-      !-----------------------------------!
-      !  Computation of solar irradiance  !
-      !-----------------------------------!
-!!gm : hard coded  leap year ???
-      indaet   = 1                                    ! = -1, 0, 1 for odd, normal and leap years resp.
-      zxday = nday_year + rdtbs2 / rday               ! day of the year at which the fluxes are calculated
-      iday  = INT( zxday )                            ! (centred at the middle of the ice time step)
-      CALL flx_blk_declin( indaet, iday, zdecl )      ! solar declination of the current day
-      zsdecl = SIN( zdecl * rad )                     ! its sine
-      zcdecl = COS( zdecl * rad )                     ! its cosine
-
-
-      !  correction factor added for computation of shortwave flux to take into account the variation of
-      !  the distance between the sun and the earth during the year (Oberhuber 1988)
-      zdist    = zxday * 2. * rpi / REAL(nyear_len(1), wp)
-      zdaycor  = 1.0 + 0.0013 * SIN( zdist ) + 0.0342 * COS( zdist )
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            !  product of sine (cosine) of latitude and sine (cosine) of solar declination
-            zps(ji,jj) = SIN( gphit(ji,jj) * rad ) * zsdecl
-            zpc(ji,jj) = COS( gphit(ji,jj) * rad ) * zcdecl
-            !  computation of the both local time of sunrise and sunset
-            zlsrise(ji,jj) = ACOS( - SIGN( 1.e0, zps(ji,jj) )    &
-               &                   * MIN(  1.e0, SIGN( 1.e0, zps(ji,jj) ) * ( zps(ji,jj) / zpc(ji,jj) )  )   )
-            zlsset (ji,jj) = - zlsrise(ji,jj)
-            !  dividing the solar day into jp24 segments of length zdlha
-            zdlha  (ji,jj) = ( zlsrise(ji,jj) - zlsset(ji,jj) ) / REAL( jp24, wp )
-         END DO
-      END DO
-
-
-      !---------------------------------------------!
-      !  shortwave radiation absorbed by the ocean  !
-      !---------------------------------------------!
-      pqsr_oce(:,:)   = 0.e0      ! set ocean qsr to zero      
-
-      ! compute and sum ocean qsr over the daylight (i.e. between sunrise and sunset)
-      DO jt = 1, jp24
-         zcoef = FLOAT( jt ) - 0.5
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zlha = COS(  zlsrise(ji,jj) - zcoef * zdlha(ji,jj)  )                  ! local hour angle
-               zcmue              = MAX( 0.e0 ,   zps(ji,jj) + zpc(ji,jj) * zlha  )   ! cos of local solar altitude
-               zcmue2             = 1368.0 * zcmue * zcmue
-
-               ! ocean albedo depending on the cloud cover (Payne, 1972)
-               za_oce     = ( 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ) * 0.05 / ( 1.1 * zcmue**1.4 + 0.15 )   &   ! clear sky
-                  &       +         sf(jp_ccov)%fnow(ji,jj,1)   * 0.06                                     ! overcast
-
-                  ! solar heat flux absorbed by the ocean (Zillman, 1972)
-               pqsr_oce(ji,jj) = pqsr_oce(ji,jj)                                         &
-                  &            + ( 1.0 - za_oce ) * zdlha(ji,jj) * zcmue2                &
-                  &            / ( ( zcmue + 2.7 ) * zev(ji,jj) + 1.085 * zcmue +  0.10 )
-            END DO
-         END DO
-      END DO
-      ! Taking into account the ellipsity of the earth orbit, the clouds AND masked if sea-ice cover > 0%
-      zcoef1 = srgamma * zdaycor / ( 2. * rpi )
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zlmunoon = ASIN( zps(ji,jj) + zpc(ji,jj) ) / rad                         ! local noon solar altitude
-            zcldcor  = MIN(  1.e0, ( 1.e0 - 0.62 * sf(jp_ccov)%fnow(ji,jj,1)   &     ! cloud correction (Reed 1977)
-               &                          + 0.0019 * zlmunoon )                 )
-            pqsr_oce(ji,jj) = zcoef1 * zcldcor * pqsr_oce(ji,jj) * tmask(ji,jj,1)    ! and zcoef1: ellipsity
-         END DO
-      END DO
-
-      CALL wrk_dealloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_clio_qsr_oce')
-      !
-   END SUBROUTINE blk_clio_qsr_oce
-
-
-   SUBROUTINE blk_clio_qsr_ice( pa_ice_cs, pa_ice_os, pqsr_ice )
-      !!---------------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_clio_qsr_ice  ***
-      !!                 
-      !!  ** Purpose :   Computation of the shortwave radiation at the ocean and the
-      !!               snow/ice surfaces. 
-      !!         
-      !!  ** Method  : - computed qsr from the cloud cover for both ice and ocean 
-      !!               - also initialise sbudyko and stauc once for all 
-      !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pa_ice_cs   ! albedo of ice under clear sky
-      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pa_ice_os   ! albedo of ice under overcast sky
-      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqsr_ice    ! shortwave radiation over the ice/snow
-      !!
-      INTEGER, PARAMETER  ::   jp24 = 24   ! sampling of the daylight period (sunrise to sunset) into 24 equal parts
-      !!
-      INTEGER  ::   ji, jj, jl, jt    ! dummy loop indices
-      INTEGER  ::   ijpl              ! number of ice categories (3rd dim of pqsr_ice)
-      INTEGER  ::   indaet            !  = -1, 0, 1 for odd, normal and leap years resp.
-      INTEGER  ::   iday              ! integer part of day
-      !!
-      REAL(wp) ::   zcmue, zcmue2, ztamr          ! temporary scalars 
-      REAL(wp) ::   zmt1, zmt2, zmt3              !    -         -
-      REAL(wp) ::   zdecl, zsdecl, zcdecl         !    -         -
-      REAL(wp) ::   zlha, zdaycor, zes            !    -         -
-      REAL(wp) ::   zxday, zdist, zcoef, zcoef1   !    -         -
-      REAL(wp) ::   zqsr_ice_cs, zqsr_ice_os      !    -         -
-
-      REAL(wp), DIMENSION(:,:), POINTER ::   zev                      ! vapour pressure
-      REAL(wp), DIMENSION(:,:), POINTER ::   zdlha, zlsrise, zlsset   ! 2D workspace
-      REAL(wp), DIMENSION(:,:), POINTER ::   zps, zpc   ! sine (cosine) of latitude per sine (cosine) of solar declination 
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_clio_qsr_ice')
-      !
-      CALL wrk_alloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
-
-      ijpl = SIZE(pqsr_ice, 3 )      ! number of ice categories
-      
-      ! Saturated water vapour and vapour pressure
-      ! ------------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi           
-            ztamr = sf(jp_tair)%fnow(ji,jj,1) - rtt           
-            zmt1  = SIGN( 17.269,  ztamr )
-            zmt2  = SIGN( 21.875,  ztamr )
-            zmt3  = SIGN( 28.200, -ztamr )
-            zes = 611.0 * EXP(  ABS( ztamr ) * MIN ( zmt1, zmt2 )   &              ! Saturation water vapour
-               &                     / ( sf(jp_tair)%fnow(ji,jj,1) - 35.86  + MAX( 0.e0, zmt3 ) )  )
-            zev(ji,jj) = sf(jp_humi)%fnow(ji,jj,1) * zes * 1.0e-05                 ! vapour pressure  
-         END DO
-      END DO
-
-      !-----------------------------------!
-      !  Computation of solar irradiance  !
-      !-----------------------------------!
-!!gm : hard coded  leap year ???
-      indaet   = 1                                    ! = -1, 0, 1 for odd, normal and leap years resp.
-      zxday = nday_year + rdtbs2 / rday               ! day of the year at which the fluxes are calculated
-      iday  = INT( zxday )                            ! (centred at the middle of the ice time step)
-      CALL flx_blk_declin( indaet, iday, zdecl )      ! solar declination of the current day
-      zsdecl = SIN( zdecl * rad )                     ! its sine
-      zcdecl = COS( zdecl * rad )                     ! its cosine
-
-      
-      !  correction factor added for computation of shortwave flux to take into account the variation of
-      !  the distance between the sun and the earth during the year (Oberhuber 1988)
-      zdist    = zxday * 2. * rpi / REAL(nyear_len(1), wp)
-      zdaycor  = 1.0 + 0.0013 * SIN( zdist ) + 0.0342 * COS( zdist )
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            !  product of sine (cosine) of latitude and sine (cosine) of solar declination
-            zps(ji,jj) = SIN( gphit(ji,jj) * rad ) * zsdecl
-            zpc(ji,jj) = COS( gphit(ji,jj) * rad ) * zcdecl
-            !  computation of the both local time of sunrise and sunset
-            zlsrise(ji,jj) = ACOS( - SIGN( 1.e0, zps(ji,jj) )    &
-               &                   * MIN(  1.e0, SIGN( 1.e0, zps(ji,jj) ) * ( zps(ji,jj) / zpc(ji,jj) )  )   ) 
-            zlsset (ji,jj) = - zlsrise(ji,jj)
-            !  dividing the solar day into jp24 segments of length zdlha
-            zdlha  (ji,jj) = ( zlsrise(ji,jj) - zlsset(ji,jj) ) / REAL( jp24, wp )
-         END DO
-      END DO
-
-
-      !---------------------------------------------!
-      !  shortwave radiation absorbed by the ice    !
-      !---------------------------------------------!
-      ! compute and sum ice qsr over the daylight for each ice categories
-      pqsr_ice(:,:,:) = 0.e0
-      zcoef1 = zdaycor / ( 2. * rpi )       ! Correction for the ellipsity of the earth orbit
-      
-      !                    !----------------------------! 
-      DO jl = 1, ijpl      !  loop over ice categories  !
-         !                 !----------------------------! 
-         DO jt = 1, jp24   
-            zcoef = FLOAT( jt ) - 0.5
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zlha = COS(  zlsrise(ji,jj) - zcoef * zdlha(ji,jj)  )                  ! local hour angle
-                  zcmue              = MAX( 0.e0 ,   zps(ji,jj) + zpc(ji,jj) * zlha  )   ! cos of local solar altitude
-                  zcmue2             = 1368.0 * zcmue * zcmue
-                  
-                  !  solar heat flux absorbed by the ice/snow system (Shine and Crane 1984 adapted to high albedo) 
-                  zqsr_ice_cs =  ( 1.0 - pa_ice_cs(ji,jj,jl) ) * zdlha(ji,jj) * zcmue2        &   ! clear sky
-                     &        / ( ( 1.0 + zcmue ) * zev(ji,jj) + 1.2 * zcmue + 0.0455 )
-                  zqsr_ice_os = zdlha(ji,jj) * SQRT( zcmue )                                  &   ! overcast sky
-                     &        * ( 53.5 + 1274.5 * zcmue )      * ( 1.0 - 0.996  * pa_ice_os(ji,jj,jl) )    &
-                     &        / (  1.0 + 0.139  * stauc(ji,jj) * ( 1.0 - 0.9435 * pa_ice_os(ji,jj,jl) ) )       
-             
-                  pqsr_ice(ji,jj,jl) = pqsr_ice(ji,jj,jl) + (  ( 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ) * zqsr_ice_cs    &
-                     &                                       +         sf(jp_ccov)%fnow(ji,jj,1)   * zqsr_ice_os  )
-               END DO
-            END DO
-         END DO
-         !
-         ! Correction : Taking into account the ellipsity of the earth orbit
-         pqsr_ice(:,:,jl) = pqsr_ice(:,:,jl) * zcoef1 * tmask(:,:,1)
-         !
-         !                 !--------------------------------! 
-      END DO               !  end loop over ice categories  !
-      !                    !--------------------------------! 
-
-
-!!gm  : this should be suppress as input data have been passed through lbc_lnk
-      DO jl = 1, ijpl
-         CALL lbc_lnk( pqsr_ice(:,:,jl) , 'T', 1. )
-      END DO
-      !
-      CALL wrk_dealloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_clio_qsr_ice')
-      !
-   END SUBROUTINE blk_clio_qsr_ice
-
-
-   SUBROUTINE flx_blk_declin( ky, kday, pdecl )
-      !!---------------------------------------------------------------------------
-      !!               ***  ROUTINE flx_blk_declin  ***
-      !!          
-      !! ** Purpose :   Computation of the solar declination for the day
-      !!       
-      !! ** Method  :   ???
-      !!---------------------------------------------------------------------
-      INTEGER , INTENT(in   ) ::   ky      ! = -1, 0, 1 for odd, normal and leap years resp.
-      INTEGER , INTENT(in   ) ::   kday    ! day of the year ( kday = 1 on january 1)
-      REAL(wp), INTENT(  out) ::   pdecl   ! solar declination
-      !!
-      REAL(wp) ::   a0  =  0.39507671      ! coefficients for solar declinaison computation
-      REAL(wp) ::   a1  = 22.85684301      !     "              ""                 "
-      REAL(wp) ::   a2  = -0.38637317      !     "              ""                 "
-      REAL(wp) ::   a3  =  0.15096535      !     "              ""                 "
-      REAL(wp) ::   a4  = -0.00961411      !     "              ""                 "
-      REAL(wp) ::   b1  = -4.29692073      !     "              ""                 "
-      REAL(wp) ::   b2  =  0.05702074      !     "              ""                 "
-      REAL(wp) ::   b3  = -0.09028607      !     "              ""                 "
-      REAL(wp) ::   b4  =  0.00592797
-      !!
-      REAL(wp) ::   zday   ! corresponding day of type year (cf. ky)
-      REAL(wp) ::   zp     ! temporary scalars
-      !!---------------------------------------------------------------------
-            
-      IF    ( ky == 1 )  THEN   ;   zday = REAL( kday, wp ) - 0.5
-      ELSEIF( ky == 3 )  THEN   ;   zday = REAL( kday, wp ) - 1.
-      ELSE                      ;   zday = REAL( kday, wp )
-      ENDIF
-      
-      zp = rpi * ( 2.0 * zday - 367.0 ) / REAL(nyear_len(1), wp)
-      
-      pdecl  = a0                                                                      &
-         &   + a1 * COS( zp ) + a2 * COS( 2. * zp ) + a3 * COS( 3. * zp ) + a4 * COS( 4. * zp )   &
-         &   + b1 * SIN( zp ) + b2 * SIN( 2. * zp ) + b3 * SIN( 3. * zp ) + b4 * SIN( 4. * zp )
-      !
-   END SUBROUTINE flx_blk_declin
-
-   !!======================================================================
-END MODULE sbcblk_clio
Index: anches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 7279)
+++ 	(revision )
@@ -1,906 +1,0 @@
-MODULE sbcblk_core
-   !!======================================================================
-   !!                       ***  MODULE  sbcblk_core  ***
-   !! Ocean forcing:  momentum, heat and freshwater flux formulation
-   !!=====================================================================
-   !! History :  1.0  !  2004-08  (U. Schweckendiek)  Original code
-   !!            2.0  !  2005-04  (L. Brodeau, A.M. Treguier) additions:
-   !!                           -  new bulk routine for efficiency
-   !!                           -  WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!!
-   !!                           -  file names and file characteristics in namelist
-   !!                           -  Implement reading of 6-hourly fields
-   !!            3.0  !  2006-06  (G. Madec) sbc rewritting
-   !!             -   !  2006-12  (L. Brodeau) Original code for turb_core_2z
-   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put
-   !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle
-   !!            3.4  !  2011-11  (C. Harris) Fill arrays required by CICE
-   !!            3.7  !  2014-06  (L. Brodeau) simplification and optimization of CORE bulk
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!   sbc_blk_core  : bulk formulation as ocean surface boundary condition (forced mode, CORE bulk formulea)
-   !!   blk_oce_core  : computes momentum, heat and freshwater fluxes over ocean
-   !!   blk_ice_core  : computes momentum, heat and freshwater fluxes over ice
-   !!   turb_core_2z  : Computes turbulent transfert coefficients
-   !!   cd_neutral_10m: Estimate of the neutral drag coefficient at 10m
-   !!   psi_m         : universal profile stability function for momentum
-   !!   psi_h         : universal profile stability function for temperature and humidity
-   !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and tracers
-   USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants
-   USE fldread        ! read input fields
-   USE sbc_oce        ! Surface boundary condition: ocean fields
-   USE cyclone        ! Cyclone 10m wind form trac of cyclone centres
-   USE sbcdcy         ! surface boundary condition: diurnal cycle
-   USE sbcwave , ONLY :   cdn_wave ! wave module
-   USE sbc_ice        ! Surface boundary condition: ice fields
-   USE lib_fortran    ! to use key_nosignedzero
-#if defined key_lim3
-   USE ice     , ONLY :   u_ice, v_ice, jpl, pfrld, a_i_b
-   USE limthd_dh      ! for CALL lim_thd_snwblow
-#elif defined key_lim2
-   USE ice_2   , ONLY :   u_ice, v_ice
-   USE par_ice_2      ! LIM-2 parameters
-#endif
-   !
-   USE iom            ! I/O manager library
-   USE in_out_manager ! I/O manager
-   USE lib_mpp        ! distribued memory computing library
-   USE wrk_nemo       ! work arrays
-   USE timing         ! Timing
-   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE prtctl         ! Print control
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   sbc_blk_core         ! routine called in sbcmod module
-#if defined key_lim2 || defined key_lim3
-   PUBLIC   blk_ice_core_tau     ! routine called in sbc_ice_lim module
-   PUBLIC   blk_ice_core_flx     ! routine called in sbc_ice_lim module
-#endif
-   PUBLIC   turb_core_2z         ! routine calles in sbcblk_mfs module
-
-   INTEGER , PARAMETER ::   jpfld   = 9           ! maximum number of files to read
-   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
-   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point
-   INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( % )
-   INTEGER , PARAMETER ::   jp_qsr  = 4           ! index of solar heat                      (W/m2)
-   INTEGER , PARAMETER ::   jp_qlw  = 5           ! index of Long wave                       (W/m2)
-   INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin)
-   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
-   INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
-   INTEGER , PARAMETER ::   jp_tdif = 9           ! index of tau diff associated to HF tau   (N/m2)   at T-point
-
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
-
-   !                                             !!! CORE bulk parameters
-   REAL(wp), PARAMETER ::   rhoa =    1.22        ! air density
-   REAL(wp), PARAMETER ::   cpa  = 1000.5         ! specific heat of air
-   REAL(wp), PARAMETER ::   Lv   =    2.5e6       ! latent heat of vaporization
-   REAL(wp), PARAMETER ::   Ls   =    2.839e6     ! latent heat of sublimation
-   REAL(wp), PARAMETER ::   Stef =    5.67e-8     ! Stefan Boltzmann constant
-   REAL(wp), PARAMETER ::   Cice =    1.4e-3      ! iovi 1.63e-3     ! transfer coefficient over ice
-   REAL(wp), PARAMETER ::   albo =    0.066       ! ocean albedo assumed to be constant
-
-   !                        !!* Namelist namsbc_core : CORE bulk parameters
-   LOGICAL  ::   ln_taudif   ! logical flag to use the "mean of stress module - module of mean stress" data
-   REAL(wp) ::   rn_pfac     ! multiplication factor for precipitation
-   REAL(wp) ::   rn_efac     ! multiplication factor for evaporation (clem)
-   REAL(wp) ::   rn_vfac     ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem)
-   REAL(wp) ::   rn_zqt      ! z(q,t) : height of humidity and temperature measurements
-   REAL(wp) ::   rn_zu       ! z(u)   : height of wind measurements
-
-   !! * Substitutions
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.7 , NEMO-consortium (2014)
-   !! $Id$
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE sbc_blk_core( kt )
-      !!---------------------------------------------------------------------
-      !!                    ***  ROUTINE sbc_blk_core  ***
-      !!
-      !! ** Purpose :   provide at each time step the surface ocean fluxes
-      !!      (momentum, heat, freshwater and runoff)
-      !!
-      !! ** Method  : (1) READ each fluxes in NetCDF files:
-      !!      the 10m wind velocity (i-component) (m/s)    at T-point
-      !!      the 10m wind velocity (j-component) (m/s)    at T-point
-      !!      the 10m or 2m specific humidity     ( % )
-      !!      the solar heat                      (W/m2)
-      !!      the Long wave                       (W/m2)
-      !!      the 10m or 2m air temperature       (Kelvin)
-      !!      the total precipitation (rain+snow) (Kg/m2/s)
-      !!      the snow (solid prcipitation)       (kg/m2/s)
-      !!      the tau diff associated to HF tau   (N/m2)   at T-point   (ln_taudif=T)
-      !!              (2) CALL blk_oce_core
-      !!
-      !!      C A U T I O N : never mask the surface stress fields
-      !!                      the stress is assumed to be in the (i,j) mesh referential
-      !!
-      !! ** Action  :   defined at each time-step at the air-sea interface
-      !!              - utau, vtau  i- and j-component of the wind stress
-      !!              - taum        wind stress module at T-point
-      !!              - wndm        wind speed  module at T-point over free ocean or leads in presence of sea-ice
-      !!              - qns, qsr    non-solar and solar heat fluxes
-      !!              - emp         upward mass flux (evapo. - precip.)
-      !!              - sfx         salt flux due to freezing/melting (non-zero only if ice is present)
-      !!                            (set in limsbc(_2).F90)
-      !!
-      !! ** References :   Large & Yeager, 2004 / Large & Yeager, 2008
-      !!                   Brodeau et al. Ocean Modelling 2010
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt   ! ocean time step
-      !
-      INTEGER  ::   ierror   ! return error code
-      INTEGER  ::   ifpr     ! dummy loop indice
-      INTEGER  ::   jfld     ! dummy loop arguments
-      INTEGER  ::   ios      ! Local integer output status for namelist read
-      !
-      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files
-      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read
-      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr       ! informations about the fields to be read
-      TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !   "                                 "
-      TYPE(FLD_N) ::   sn_tdif                                 !   "                                 "
-      NAMELIST/namsbc_core/ cn_dir , ln_taudif, rn_pfac, rn_efac, rn_vfac,  &
-         &                  sn_wndi, sn_wndj  , sn_humi, sn_qsr ,           &
-         &                  sn_qlw , sn_tair  , sn_prec, sn_snow,           &
-         &                  sn_tdif, rn_zqt   ,  rn_zu
-      !!---------------------------------------------------------------------
-      !
-      !                                         ! ====================== !
-      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
-         !                                      ! ====================== !
-         !
-         REWIND( numnam_ref )              ! Namelist namsbc_core in reference namelist : CORE bulk parameters
-         READ  ( numnam_ref, namsbc_core, IOSTAT = ios, ERR = 901)
-901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in reference namelist', lwp )
-         !
-         REWIND( numnam_cfg )              ! Namelist namsbc_core in configuration namelist : CORE bulk parameters
-         READ  ( numnam_cfg, namsbc_core, IOSTAT = ios, ERR = 902 )
-902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in configuration namelist', lwp )
-
-         IF(lwm) WRITE( numond, namsbc_core )
-         !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing?
-         IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 )   &
-            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' )
-         IF( ln_dm2dc .AND. sn_qsr%ln_tint ) THEN
-            CALL ctl_warn( 'sbc_blk_core: ln_dm2dc is taking care of the temporal interpolation of daily qsr',   &
-               &         '              ==> We force time interpolation = .false. for qsr' )
-            sn_qsr%ln_tint = .false.
-         ENDIF
-         !                                         ! store namelist information in an array
-         slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj
-         slf_i(jp_qsr ) = sn_qsr    ;   slf_i(jp_qlw ) = sn_qlw
-         slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi
-         slf_i(jp_prec) = sn_prec   ;   slf_i(jp_snow) = sn_snow
-         slf_i(jp_tdif) = sn_tdif
-         !
-         lhftau = ln_taudif                        ! do we use HF tau information?
-         jfld = jpfld - COUNT( (/.NOT. lhftau/) )
-         !
-         ALLOCATE( sf(jfld), STAT=ierror )         ! set sf structure
-         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_core: unable to allocate sf structure' )
-         DO ifpr= 1, jfld
-            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
-            IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
-         END DO
-         !                                         ! fill sf with slf_i and control print
-         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_core', 'flux formulation for ocean surface boundary condition', 'namsbc_core' )
-         !
-         sfx(:,:) = 0._wp                          ! salt flux; zero unless ice is present (computed in limsbc(_2).F90)
-         !
-      ENDIF
-
-      CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step
-
-      !                                            ! compute the surface ocean fluxes using CORE bulk formulea
-      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m )
-
-#if defined key_cice
-      IF( MOD( kt - 1, nn_fsbc ) == 0 )   THEN
-         qlw_ice(:,:,1)   = sf(jp_qlw)%fnow(:,:,1) 
-         qsr_ice(:,:,1)   = sf(jp_qsr)%fnow(:,:,1)
-         tatm_ice(:,:)    = sf(jp_tair)%fnow(:,:,1)         
-         qatm_ice(:,:)    = sf(jp_humi)%fnow(:,:,1)
-         tprecip(:,:)     = sf(jp_prec)%fnow(:,:,1) * rn_pfac
-         sprecip(:,:)     = sf(jp_snow)%fnow(:,:,1) * rn_pfac
-         wndi_ice(:,:)    = sf(jp_wndi)%fnow(:,:,1)
-         wndj_ice(:,:)    = sf(jp_wndj)%fnow(:,:,1)
-      ENDIF
-#endif
-      !
-   END SUBROUTINE sbc_blk_core
-   
-   
-   SUBROUTINE blk_oce_core( kt, sf, pst, pu, pv )
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_core  ***
-      !!
-      !! ** Purpose :   provide the momentum, heat and freshwater fluxes at
-      !!      the ocean surface at each time step
-      !!
-      !! ** Method  :   CORE bulk formulea for the ocean using atmospheric
-      !!      fields read in sbc_read
-      !! 
-      !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2)
-      !!              - vtau    : j-component of the stress at V-point  (N/m2)
-      !!              - taum    : Wind stress module at T-point         (N/m2)
-      !!              - wndm    : Wind speed module at T-point          (m/s)
-      !!              - qsr     : Solar heat flux over the ocean        (W/m2)
-      !!              - qns     : Non Solar heat flux over the ocean    (W/m2)
-      !!              - emp     : evaporation minus precipitation       (kg/m2/s)
-      !!
-      !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC
-      !!---------------------------------------------------------------------
-      INTEGER  , INTENT(in   )                 ::   kt    ! time step index
-      TYPE(fld), INTENT(inout), DIMENSION(:)   ::   sf    ! input data
-      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pst   ! surface temperature                      [Celsius]
-      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s]
-      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s]
-      !
-      INTEGER  ::   ji, jj               ! dummy loop indices
-      REAL(wp) ::   zcoef_qsatw, zztmp   ! local variable
-      REAL(wp), DIMENSION(:,:), POINTER ::   zwnd_i, zwnd_j    ! wind speed components at T-point
-      REAL(wp), DIMENSION(:,:), POINTER ::   zqsatw            ! specific humidity at pst
-      REAL(wp), DIMENSION(:,:), POINTER ::   zqlw, zqsb        ! long wave and sensible heat fluxes
-      REAL(wp), DIMENSION(:,:), POINTER ::   zqla, zevap       ! latent heat fluxes and evaporation
-      REAL(wp), DIMENSION(:,:), POINTER ::   Cd                ! transfer coefficient for momentum      (tau)
-      REAL(wp), DIMENSION(:,:), POINTER ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
-      REAL(wp), DIMENSION(:,:), POINTER ::   Ce                ! tansfert coefficient for evaporation   (Q_lat)
-      REAL(wp), DIMENSION(:,:), POINTER ::   zst               ! surface temperature in Kelvin
-      REAL(wp), DIMENSION(:,:), POINTER ::   zt_zu             ! air temperature at wind speed height
-      REAL(wp), DIMENSION(:,:), POINTER ::   zq_zu             ! air spec. hum.  at wind speed height
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_oce_core')
-      !
-      CALL wrk_alloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zqlw, zqsb, zqla, zevap )
-      CALL wrk_alloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu )
-      !
-      ! local scalars ( place there for vector optimisation purposes)
-      zcoef_qsatw = 0.98 * 640380. / rhoa
-      
-      zst(:,:) = pst(:,:) + rt0      ! convert SST from Celsius to Kelvin (and set minimum value far above 0 K)
-
-      ! ----------------------------------------------------------------------------- !
-      !      0   Wind components and module at T-point relative to the moving ocean   !
-      ! ----------------------------------------------------------------------------- !
-
-      ! ... components ( U10m - U_oce ) at T-point (unmasked)
-      zwnd_i(:,:) = 0.e0  
-      zwnd_j(:,:) = 0.e0
-#if defined key_cyclone
-      CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012)
-      DO jj = 2, jpjm1
-         DO ji = fs_2, fs_jpim1   ! vect. opt.
-            sf(jp_wndi)%fnow(ji,jj,1) = sf(jp_wndi)%fnow(ji,jj,1) + zwnd_i(ji,jj)
-            sf(jp_wndj)%fnow(ji,jj,1) = sf(jp_wndj)%fnow(ji,jj,1) + zwnd_j(ji,jj)
-         END DO
-      END DO
-#endif
-      DO jj = 2, jpjm1
-         DO ji = fs_2, fs_jpim1   ! vect. opt.
-            zwnd_i(ji,jj) = (  sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  )
-            zwnd_j(ji,jj) = (  sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  )
-         END DO
-      END DO
-      CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. )
-      CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. )
-      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
-      wndm(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   &
-         &             + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1)
-
-      ! ----------------------------------------------------------------------------- !
-      !      I   Radiative FLUXES                                                     !
-      ! ----------------------------------------------------------------------------- !
-
-      ! ocean albedo assumed to be constant + modify now Qsr to include the diurnal cycle                    ! Short Wave
-      zztmp = 1. - albo
-      IF( ln_dm2dc ) THEN   ;   qsr(:,:) = zztmp * sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1)
-      ELSE                  ;   qsr(:,:) = zztmp *          sf(jp_qsr)%fnow(:,:,1)   * tmask(:,:,1)
-      ENDIF
-
-      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
-      ! ----------------------------------------------------------------------------- !
-      !     II    Turbulent FLUXES                                                    !
-      ! ----------------------------------------------------------------------------- !
-
-      ! ... specific humidity at SST and IST
-      zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) )
-
-      ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point :
-      CALL turb_core_2z( rn_zqt, rn_zu, zst, sf(jp_tair)%fnow, zqsatw, sf(jp_humi)%fnow, wndm,   &
-         &               Cd, Ch, Ce, zt_zu, zq_zu )
-    
-      ! ... tau module, i and j component
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zztmp = rhoa * wndm(ji,jj) * Cd(ji,jj)
-            taum  (ji,jj) = zztmp * wndm  (ji,jj)
-            zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj)
-            zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj)
-         END DO
-      END DO
-
-      ! ... add the HF tau contribution to the wind stress module?
-      IF( lhftau ) THEN
-         taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1)
-      ENDIF
-      CALL iom_put( "taum_oce", taum )   ! output wind stress module
-
-      ! ... utau, vtau at U- and V_points, resp.
-      !     Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines
-      !     Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves
-      DO jj = 1, jpjm1
-         DO ji = 1, fs_jpim1
-            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) &
-               &          * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1))
-            vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) &
-               &          * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1))
-         END DO
-      END DO
-      CALL lbc_lnk( utau(:,:), 'U', -1. )
-      CALL lbc_lnk( vtau(:,:), 'V', -1. )
-
-    
-      !  Turbulent fluxes over ocean
-      ! -----------------------------
-      IF( ABS( rn_zu - rn_zqt) < 0.01_wp ) THEN
-         !! q_air and t_air are (or "are almost") given at 10m (wind reference height)
-         zevap(:,:) = rn_efac*MAX( 0._wp,     rhoa*Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:,1) )*wndm(:,:) ) ! Evaporation
-         zqsb (:,:) =                     cpa*rhoa*Ch(:,:)*( zst   (:,:) - sf(jp_tair)%fnow(:,:,1) )*wndm(:,:)   ! Sensible Heat
-      ELSE
-         !! q_air and t_air are not given at 10m (wind reference height)
-         ! Values of temp. and hum. adjusted to height of wind during bulk algorithm iteration must be used!!!
-         zevap(:,:) = rn_efac*MAX( 0._wp,     rhoa*Ce(:,:)*( zqsatw(:,:) - zq_zu(:,:) )*wndm(:,:) )   ! Evaporation
-         zqsb (:,:) =                     cpa*rhoa*Ch(:,:)*( zst   (:,:) - zt_zu(:,:) )*wndm(:,:)     ! Sensible Heat
-      ENDIF
-      zqla (:,:) = Lv * zevap(:,:)                                                              ! Latent Heat
-
-      IF(ln_ctl) THEN
-         CALL prt_ctl( tab2d_1=zqla  , clinfo1=' blk_oce_core: zqla   : ', tab2d_2=Ce , clinfo2=' Ce  : ' )
-         CALL prt_ctl( tab2d_1=zqsb  , clinfo1=' blk_oce_core: zqsb   : ', tab2d_2=Ch , clinfo2=' Ch  : ' )
-         CALL prt_ctl( tab2d_1=zqlw  , clinfo1=' blk_oce_core: zqlw   : ', tab2d_2=qsr, clinfo2=' qsr : ' )
-         CALL prt_ctl( tab2d_1=zqsatw, clinfo1=' blk_oce_core: zqsatw : ', tab2d_2=zst, clinfo2=' zst : ' )
-         CALL prt_ctl( tab2d_1=utau  , clinfo1=' blk_oce_core: utau   : ', mask1=umask,   &
-            &          tab2d_2=vtau  , clinfo2=              ' vtau : '  , mask2=vmask )
-         CALL prt_ctl( tab2d_1=wndm  , clinfo1=' blk_oce_core: wndm   : ')
-         CALL prt_ctl( tab2d_1=zst   , clinfo1=' blk_oce_core: zst    : ')
-      ENDIF
-       
-      ! ----------------------------------------------------------------------------- !
-      !     III    Total FLUXES                                                       !
-      ! ----------------------------------------------------------------------------- !
-      !
-      emp (:,:) = (  zevap(:,:)                                          &   ! mass flux (evap. - precip.)
-         &         - sf(jp_prec)%fnow(:,:,1) * rn_pfac  ) * tmask(:,:,1)
-      !
-      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                &   ! Downward Non Solar 
-         &     - sf(jp_snow)%fnow(:,:,1) * rn_pfac * lfus                         &   ! remove latent melting heat for solid precip
-         &     - zevap(:,:) * pst(:,:) * rcp                                      &   ! remove evap heat content at SST
-         &     + ( sf(jp_prec)%fnow(:,:,1) - sf(jp_snow)%fnow(:,:,1) ) * rn_pfac  &   ! add liquid precip heat content at Tair
-         &     * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp                          &
-         &     + sf(jp_snow)%fnow(:,:,1) * rn_pfac                                &   ! add solid  precip heat content at min(Tair,Tsnow)
-         &     * ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1)
-      !
-#if defined key_lim3
-      qns_oce(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                ! non solar without emp (only needed by LIM3)
-      qsr_oce(:,:) = qsr(:,:)
-#endif
-      !
-      IF ( nn_ice == 0 ) THEN
-         CALL iom_put( "qlw_oce" ,   zqlw )                 ! output downward longwave heat over the ocean
-         CALL iom_put( "qsb_oce" , - zqsb )                 ! output downward sensible heat over the ocean
-         CALL iom_put( "qla_oce" , - zqla )                 ! output downward latent   heat over the ocean
-         CALL iom_put( "qemp_oce",   qns-zqlw+zqsb+zqla )   ! output downward heat content of E-P over the ocean
-         CALL iom_put( "qns_oce" ,   qns  )                 ! output downward non solar heat over the ocean
-         CALL iom_put( "qsr_oce" ,   qsr  )                 ! output downward solar heat over the ocean
-         CALL iom_put( "qt_oce"  ,   qns+qsr )              ! output total downward heat over the ocean
-         tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac   ! output total precipitation [kg/m2/s]
-         sprecip(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac   ! output solid precipitation [kg/m2/s]
-         CALL iom_put( 'snowpre', sprecip * 86400. )        ! Snow
-         CALL iom_put( 'precip' , tprecip * 86400. )        ! Total precipitation
-      ENDIF
-      !
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce_core: zqsb   : ', tab2d_2=zqlw , clinfo2=' zqlw  : ')
-         CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce_core: zqla   : ', tab2d_2=qsr  , clinfo2=' qsr   : ')
-         CALL prt_ctl(tab2d_1=pst  , clinfo1=' blk_oce_core: pst    : ', tab2d_2=emp  , clinfo2=' emp   : ')
-         CALL prt_ctl(tab2d_1=utau , clinfo1=' blk_oce_core: utau   : ', mask1=umask,   &
-            &         tab2d_2=vtau , clinfo2=              ' vtau  : ' , mask2=vmask )
-      ENDIF
-      !
-      CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zqlw, zqsb, zqla, zevap )
-      CALL wrk_dealloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_oce_core')
-      !
-   END SUBROUTINE blk_oce_core
- 
-   
-#if defined key_lim2 || defined key_lim3
-   SUBROUTINE blk_ice_core_tau
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_ice_core_tau  ***
-      !!
-      !! ** Purpose :   provide the surface boundary condition over sea-ice
-      !!
-      !! ** Method  :   compute momentum using CORE bulk
-      !!                formulea, ice variables and read atmospheric fields.
-      !!                NB: ice drag coefficient is assumed to be a constant
-      !!---------------------------------------------------------------------
-      INTEGER  ::   ji, jj    ! dummy loop indices
-      REAL(wp) ::   zcoef_wnorm, zcoef_wnorm2
-      REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f               ! relative wind module and components at F-point
-      REAL(wp) ::             zwndi_t , zwndj_t               ! relative wind components at T-point
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_ice_core_tau')
-      !
-      ! local scalars ( place there for vector optimisation purposes)
-      zcoef_wnorm  = rhoa * Cice
-      zcoef_wnorm2 = rhoa * Cice * 0.5
-
-!!gm brutal....
-      utau_ice  (:,:) = 0._wp
-      vtau_ice  (:,:) = 0._wp
-      wndm_ice  (:,:) = 0._wp
-!!gm end
-
-      ! ----------------------------------------------------------------------------- !
-      !    Wind components and module relative to the moving ocean ( U10m - U_ice )   !
-      ! ----------------------------------------------------------------------------- !
-      SELECT CASE( cp_ice_msh )
-      CASE( 'I' )                  ! B-grid ice dynamics :   I-point (i.e. F-point with sea-ice indexation)
-         !                           and scalar wind at T-point ( = | U10m - U_ice | ) (masked)
-         DO jj = 2, jpjm1
-            DO ji = 2, jpim1   ! B grid : NO vector opt
-               ! ... scalar wind at I-point (fld being at T-point)
-               zwndi_f = 0.25 * (  sf(jp_wndi)%fnow(ji-1,jj  ,1) + sf(jp_wndi)%fnow(ji  ,jj  ,1)   &
-                  &              + sf(jp_wndi)%fnow(ji-1,jj-1,1) + sf(jp_wndi)%fnow(ji  ,jj-1,1)  ) - rn_vfac * u_ice(ji,jj)
-               zwndj_f = 0.25 * (  sf(jp_wndj)%fnow(ji-1,jj  ,1) + sf(jp_wndj)%fnow(ji  ,jj  ,1)   &
-                  &              + sf(jp_wndj)%fnow(ji-1,jj-1,1) + sf(jp_wndj)%fnow(ji  ,jj-1,1)  ) - rn_vfac * v_ice(ji,jj)
-               zwnorm_f = zcoef_wnorm * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f )
-               ! ... ice stress at I-point
-               utau_ice(ji,jj) = zwnorm_f * zwndi_f
-               vtau_ice(ji,jj) = zwnorm_f * zwndj_f
-               ! ... scalar wind at T-point (fld being at T-point)
-               zwndi_t = sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.25 * (  u_ice(ji,jj+1) + u_ice(ji+1,jj+1)   &
-                  &                                                    + u_ice(ji,jj  ) + u_ice(ji+1,jj  )  )
-               zwndj_t = sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.25 * (  v_ice(ji,jj+1) + v_ice(ji+1,jj+1)   &
-                  &                                                    + v_ice(ji,jj  ) + v_ice(ji+1,jj  )  )
-               wndm_ice(ji,jj)  = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
-            END DO
-         END DO
-         CALL lbc_lnk( utau_ice, 'I', -1. )
-         CALL lbc_lnk( vtau_ice, 'I', -1. )
-         CALL lbc_lnk( wndm_ice, 'T',  1. )
-         !
-      CASE( 'C' )                  ! C-grid ice dynamics :   U & V-points (same as ocean)
-         DO jj = 2, jpj
-            DO ji = fs_2, jpi   ! vect. opt.
-               zwndi_t = (  sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( u_ice(ji-1,jj  ) + u_ice(ji,jj) )  )
-               zwndj_t = (  sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( v_ice(ji  ,jj-1) + v_ice(ji,jj) )  )
-               wndm_ice(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
-            END DO
-         END DO
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vect. opt.
-               utau_ice(ji,jj) = zcoef_wnorm2 * ( wndm_ice(ji+1,jj  ) + wndm_ice(ji,jj) )                          &
-                  &          * ( 0.5 * (sf(jp_wndi)%fnow(ji+1,jj,1) + sf(jp_wndi)%fnow(ji,jj,1) ) - rn_vfac * u_ice(ji,jj) )
-               vtau_ice(ji,jj) = zcoef_wnorm2 * ( wndm_ice(ji,jj+1  ) + wndm_ice(ji,jj) )                          &
-                  &          * ( 0.5 * (sf(jp_wndj)%fnow(ji,jj+1,1) + sf(jp_wndj)%fnow(ji,jj,1) ) - rn_vfac * v_ice(ji,jj) )
-            END DO
-         END DO
-         CALL lbc_lnk( utau_ice, 'U', -1. )
-         CALL lbc_lnk( vtau_ice, 'V', -1. )
-         CALL lbc_lnk( wndm_ice, 'T',  1. )
-         !
-      END SELECT
-
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab2d_1=utau_ice  , clinfo1=' blk_ice_core: utau_ice : ', tab2d_2=vtau_ice  , clinfo2=' vtau_ice : ')
-         CALL prt_ctl(tab2d_1=wndm_ice  , clinfo1=' blk_ice_core: wndm_ice : ')
-      ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_core_tau')
-      
-   END SUBROUTINE blk_ice_core_tau
-
-
-   SUBROUTINE blk_ice_core_flx( ptsu, palb )
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE blk_ice_core_flx  ***
-      !!
-      !! ** Purpose :   provide the surface boundary condition over sea-ice
-      !!
-      !! ** Method  :   compute heat and freshwater exchanged
-      !!                between atmosphere and sea-ice using CORE bulk
-      !!                formulea, ice variables and read atmmospheric fields.
-      !! 
-      !! caution : the net upward water flux has with mm/day unit
-      !!---------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   ptsu          ! sea ice surface temperature
-      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   palb          ! ice albedo (all skies)
-      !!
-      INTEGER  ::   ji, jj, jl    ! dummy loop indices
-      REAL(wp) ::   zst2, zst3
-      REAL(wp) ::   zcoef_dqlw, zcoef_dqla, zcoef_dqsb
-      REAL(wp) ::   zztmp, z1_lsub                               ! temporary variable
-      !!
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qlw             ! long wave heat flux over ice
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qsb             ! sensible  heat flux over ice
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqlw            ! long wave heat sensitivity over ice
-      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqsb            ! sensible  heat sensitivity over ice
-      REAL(wp), DIMENSION(:,:)  , POINTER ::   zevap, zsnw       ! evaporation and snw distribution after wind blowing (LIM3)
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('blk_ice_core_flx')
-      !
-      CALL wrk_alloc( jpi,jpj,jpl, z_qlw, z_qsb, z_dqlw, z_dqsb ) 
-
-      ! local scalars ( place there for vector optimisation purposes)
-      zcoef_dqlw   = 4.0 * 0.95 * Stef
-      zcoef_dqla   = -Ls * Cice * 11637800. * (-5897.8)
-      zcoef_dqsb   = rhoa * cpa * Cice
-
-      zztmp = 1. / ( 1. - albo )
-      !                                     ! ========================== !
-      DO jl = 1, jpl                        !  Loop over ice categories  !
-         !                                  ! ========================== !
-         DO jj = 1 , jpj
-            DO ji = 1, jpi
-               ! ----------------------------!
-               !      I   Radiative FLUXES   !
-               ! ----------------------------!
-               zst2 = ptsu(ji,jj,jl) * ptsu(ji,jj,jl)
-               zst3 = ptsu(ji,jj,jl) * zst2
-               ! Short Wave (sw)
-               qsr_ice(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr(ji,jj)
-               ! Long  Wave (lw)
-               z_qlw(ji,jj,jl) = 0.95 * ( sf(jp_qlw)%fnow(ji,jj,1) - Stef * ptsu(ji,jj,jl) * zst3 ) * tmask(ji,jj,1)
-               ! lw sensitivity
-               z_dqlw(ji,jj,jl) = zcoef_dqlw * zst3                                               
-
-               ! ----------------------------!
-               !     II    Turbulent FLUXES  !
-               ! ----------------------------!
-
-               ! ... turbulent heat fluxes
-               ! Sensible Heat
-               z_qsb(ji,jj,jl) = rhoa * cpa * Cice * wndm_ice(ji,jj) * ( ptsu(ji,jj,jl) - sf(jp_tair)%fnow(ji,jj,1) )
-               ! Latent Heat
-               qla_ice(ji,jj,jl) = rn_efac * MAX( 0.e0, rhoa * Ls  * Cice * wndm_ice(ji,jj)   &                           
-                  &                         * (  11637800. * EXP( -5897.8 / ptsu(ji,jj,jl) ) / rhoa - sf(jp_humi)%fnow(ji,jj,1)  ) )
-              ! Latent heat sensitivity for ice (Dqla/Dt)
-               IF( qla_ice(ji,jj,jl) > 0._wp ) THEN
-                  dqla_ice(ji,jj,jl) = rn_efac * zcoef_dqla * wndm_ice(ji,jj) / ( zst2 ) * EXP( -5897.8 / ptsu(ji,jj,jl) )
-               ELSE
-                  dqla_ice(ji,jj,jl) = 0._wp
-               ENDIF
-
-               ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice)
-               z_dqsb(ji,jj,jl) = zcoef_dqsb * wndm_ice(ji,jj)
-
-               ! ----------------------------!
-               !     III    Total FLUXES     !
-               ! ----------------------------!
-               ! Downward Non Solar flux
-               qns_ice (ji,jj,jl) =     z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - qla_ice (ji,jj,jl)
-               ! Total non solar heat flux sensitivity for ice
-               dqns_ice(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + dqla_ice(ji,jj,jl) )
-            END DO
-            !
-         END DO
-         !
-      END DO
-      !
-      tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac      ! total precipitation [kg/m2/s]
-      sprecip(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac      ! solid precipitation [kg/m2/s]
-      CALL iom_put( 'snowpre', sprecip * 86400. )                  ! Snow precipitation
-      CALL iom_put( 'precip' , tprecip * 86400. )                  ! Total precipitation
-
-#if defined  key_lim3
-      CALL wrk_alloc( jpi,jpj, zevap, zsnw ) 
-
-      ! --- evaporation --- !
-      z1_lsub = 1._wp / Lsub
-      evap_ice (:,:,:) = rn_efac * qla_ice (:,:,:) * z1_lsub    ! sublimation
-      devap_ice(:,:,:) = rn_efac * dqla_ice(:,:,:) * z1_lsub    ! d(sublimation)/dT
-      zevap    (:,:)   = rn_efac * ( emp(:,:) + tprecip(:,:) )  ! evaporation over ocean
-
-      ! --- evaporation minus precipitation --- !
-      zsnw(:,:) = 0._wp
-      CALL lim_thd_snwblow( pfrld, zsnw )  ! snow distribution over ice after wind blowing 
-      emp_oce(:,:) = pfrld(:,:) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * (1._wp - zsnw )
-      emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw
-      emp_tot(:,:) = emp_oce(:,:) + emp_ice(:,:)
-
-      ! --- heat flux associated with emp --- !
-      qemp_oce(:,:) = - pfrld(:,:) * zevap(:,:) * sst_m(:,:) * rcp                               & ! evap at sst
-         &          + ( tprecip(:,:) - sprecip(:,:) ) * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp  & ! liquid precip at Tair
-         &          +   sprecip(:,:) * ( 1._wp - zsnw ) *                                        & ! solid precip at min(Tair,Tsnow)
-         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-      qemp_ice(:,:) =   sprecip(:,:) * zsnw *                                                    & ! solid precip (only)
-         &              ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-
-      ! --- total solar and non solar fluxes --- !
-      qns_tot(:,:) = pfrld(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
-      qsr_tot(:,:) = pfrld(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
-
-      ! --- heat content of precip over ice in J/m3 (to be used in 1D-thermo) --- !
-      qprec_ice(:,:) = rhosn * ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
-
-      ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- !
-      DO jl = 1, jpl
-         qevap_ice(:,:,jl) = 0._wp ! should be -evap_ice(:,:,jl)*( ( Tice - rt0 ) * cpic * tmask(:,:,1) )
-                                   ! But we do not have Tice => consider it at 0°C => evap=0 
-      END DO
-
-      CALL wrk_dealloc( jpi,jpj, zevap, zsnw ) 
-#endif
-
-      !--------------------------------------------------------------------
-      ! FRACTIONs of net shortwave radiation which is not absorbed in the
-      ! thin surface layer and penetrates inside the ice cover
-      ! ( Maykut and Untersteiner, 1971 ; Ebert and Curry, 1993 )
-      !
-      fr1_i0(:,:) = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice )
-      fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice )
-      !
-      !
-      IF(ln_ctl) THEN
-         CALL prt_ctl(tab3d_1=qla_ice , clinfo1=' blk_ice_core: qla_ice  : ', tab3d_2=z_qsb   , clinfo2=' z_qsb    : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=z_qlw   , clinfo1=' blk_ice_core: z_qlw    : ', tab3d_2=dqla_ice, clinfo2=' dqla_ice : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=z_dqsb  , clinfo1=' blk_ice_core: z_dqsb   : ', tab3d_2=z_dqlw  , clinfo2=' z_dqlw   : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=dqns_ice, clinfo1=' blk_ice_core: dqns_ice : ', tab3d_2=qsr_ice , clinfo2=' qsr_ice  : ', kdim=jpl)
-         CALL prt_ctl(tab3d_1=ptsu    , clinfo1=' blk_ice_core: ptsu     : ', tab3d_2=qns_ice , clinfo2=' qns_ice  : ', kdim=jpl)
-         CALL prt_ctl(tab2d_1=tprecip , clinfo1=' blk_ice_core: tprecip  : ', tab2d_2=sprecip , clinfo2=' sprecip  : ')
-      ENDIF
-
-      CALL wrk_dealloc( jpi,jpj,jpl, z_qlw, z_qsb, z_dqlw, z_dqsb )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('blk_ice_core_flx')
-      
-   END SUBROUTINE blk_ice_core_flx
-#endif
-
-   SUBROUTINE turb_core_2z( zt, zu, sst, T_zt, q_sat, q_zt, dU,    &
-      &                      Cd, Ch, Ce , T_zu, q_zu )
-      !!----------------------------------------------------------------------
-      !!                      ***  ROUTINE  turb_core  ***
-      !!
-      !! ** Purpose :   Computes turbulent transfert coefficients of surface
-      !!                fluxes according to Large & Yeager (2004) and Large & Yeager (2008)
-      !!                If relevant (zt /= zu), adjust temperature and humidity from height zt to zu
-      !!
-      !! ** Method : Monin Obukhov Similarity Theory 
-      !!             + Large & Yeager (2004,2008) closure: CD_n10 = f(U_n10)
-      !!
-      !! ** References :   Large & Yeager, 2004 / Large & Yeager, 2008
-      !!
-      !! ** Last update: Laurent Brodeau, June 2014:
-      !!    - handles both cases zt=zu and zt/=zu
-      !!    - optimized: less 2D arrays allocated and less operations
-      !!    - better first guess of stability by checking air-sea difference of virtual temperature
-      !!       rather than temperature difference only...
-      !!    - added function "cd_neutral_10m" that uses the improved parametrization of 
-      !!      Large & Yeager 2008. Drag-coefficient reduction for Cyclone conditions!
-      !!    - using code-wide physical constants defined into "phycst.mod" rather than redifining them
-      !!      => 'vkarmn' and 'grav'
-      !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in   )                     ::   zt       ! height for T_zt and q_zt                   [m]
-      REAL(wp), INTENT(in   )                     ::   zu       ! height for dU                              [m]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   sst      ! sea surface temperature              [Kelvin]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   T_zt     ! potential air temperature            [Kelvin]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_sat    ! sea surface specific humidity         [kg/kg]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_zt     ! specific air humidity                 [kg/kg]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   dU       ! relative wind module at zu            [m/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Cd       ! transfer coefficient for momentum         (tau)
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ch       ! transfer coefficient for sensible heat (Q_sens)
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   Ce       ! transfert coefficient for evaporation   (Q_lat)
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   T_zu     ! air temp. shifted at zu                     [K]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   q_zu     ! spec. hum.  shifted at zu               [kg/kg]
-      !
-      INTEGER ::   j_itt
-      INTEGER , PARAMETER ::   nb_itt = 5       ! number of itterations
-      LOGICAL ::   l_zt_equal_zu = .FALSE.      ! if q and t are given at different height than U
-      !
-      REAL(wp), DIMENSION(:,:), POINTER ::   U_zu          ! relative wind at zu                            [m/s]
-      REAL(wp), DIMENSION(:,:), POINTER ::   Ce_n10        ! 10m neutral latent coefficient
-      REAL(wp), DIMENSION(:,:), POINTER ::   Ch_n10        ! 10m neutral sensible coefficient
-      REAL(wp), DIMENSION(:,:), POINTER ::   sqrt_Cd_n10   ! root square of Cd_n10
-      REAL(wp), DIMENSION(:,:), POINTER ::   sqrt_Cd       ! root square of Cd
-      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_u        ! stability parameter at height zu
-      REAL(wp), DIMENSION(:,:), POINTER ::   zeta_t        ! stability parameter at height zt
-      REAL(wp), DIMENSION(:,:), POINTER ::   zpsi_h_u, zpsi_m_u
-      REAL(wp), DIMENSION(:,:), POINTER ::   ztmp0, ztmp1, ztmp2
-      REAL(wp), DIMENSION(:,:), POINTER ::   stab          ! 1st stability test integer
-      !!----------------------------------------------------------------------
-
-      IF( nn_timing == 1 )  CALL timing_start('turb_core_2z')
-    
-      CALL wrk_alloc( jpi,jpj, U_zu, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd )
-      CALL wrk_alloc( jpi,jpj, zeta_u, stab )
-      CALL wrk_alloc( jpi,jpj, zpsi_h_u, zpsi_m_u, ztmp0, ztmp1, ztmp2 )
-
-      l_zt_equal_zu = .FALSE.
-      IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE.    ! testing "zu == zt" is risky with double precision
-
-      IF( .NOT. l_zt_equal_zu )   CALL wrk_alloc( jpi,jpj, zeta_t )
-
-      U_zu = MAX( 0.5 , dU )   !  relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s
-
-      !! First guess of stability: 
-      ztmp0 = T_zt*(1. + 0.608*q_zt) - sst*(1. + 0.608*q_sat) ! air-sea difference of virtual pot. temp. at zt
-      stab  = 0.5 + sign(0.5,ztmp0)                           ! stab = 1 if dTv > 0  => STABLE, 0 if unstable
-
-      !! Neutral coefficients at 10m:
-      IF( ln_cdgw ) THEN      ! wave drag case
-         cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) )
-         ztmp0   (:,:) = cdn_wave(:,:)
-      ELSE
-         ztmp0 = cd_neutral_10m( U_zu )
-      ENDIF
-      sqrt_Cd_n10 = SQRT( ztmp0 )
-      Ce_n10  = 1.e-3*( 34.6 * sqrt_Cd_n10 )
-      Ch_n10  = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))
-    
-      !! Initializing transf. coeff. with their first guess neutral equivalents :
-      Cd = ztmp0   ;   Ce = Ce_n10   ;   Ch = Ch_n10   ;   sqrt_Cd = sqrt_Cd_n10
-
-      !! Initializing values at z_u with z_t values:
-      T_zu = T_zt   ;   q_zu = q_zt
-
-      !!  * Now starting iteration loop
-      DO j_itt=1, nb_itt
-         !
-         ztmp1 = T_zu - sst   ! Updating air/sea differences
-         ztmp2 = q_zu - q_sat 
-
-         ! Updating turbulent scales :   (L&Y 2004 eq. (7))
-         ztmp1  = Ch/sqrt_Cd*ztmp1    ! theta*
-         ztmp2  = Ce/sqrt_Cd*ztmp2    ! q*
-       
-         ztmp0 = T_zu*(1. + 0.608*q_zu) ! virtual potential temperature at zu
-
-         ! Estimate the inverse of Monin-Obukov length (1/L) at height zu:
-         ztmp0 =  (vkarmn*grav/ztmp0*(ztmp1*(1.+0.608*q_zu) + 0.608*T_zu*ztmp2)) / (Cd*U_zu*U_zu) 
-         !                                                                     ( Cd*U_zu*U_zu is U*^2 at zu)
-
-         !! Stability parameters :
-         zeta_u   = zu*ztmp0   ;  zeta_u = sign( min(abs(zeta_u),10.0), zeta_u )
-         zpsi_h_u = psi_h( zeta_u )
-         zpsi_m_u = psi_m( zeta_u )
-       
-         !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c))
-         IF ( .NOT. l_zt_equal_zu ) THEN
-            zeta_t = zt*ztmp0 ;  zeta_t = sign( min(abs(zeta_t),10.0), zeta_t )
-            stab = LOG(zu/zt) - zpsi_h_u + psi_h(zeta_t)  ! stab just used as temp array!!!
-            T_zu = T_zt + ztmp1/vkarmn*stab    ! ztmp1 is still theta*
-            q_zu = q_zt + ztmp2/vkarmn*stab    ! ztmp2 is still q*
-            q_zu = max(0., q_zu)
-         END IF
-       
-         IF( ln_cdgw ) THEN      ! surface wave case
-            sqrt_Cd = vkarmn / ( vkarmn / sqrt_Cd_n10 - zpsi_m_u ) 
-            Cd      = sqrt_Cd * sqrt_Cd
-         ELSE
-           ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)...
-           !   In very rare low-wind conditions, the old way of estimating the
-           !   neutral wind speed at 10m leads to a negative value that causes the code
-           !   to crash. To prevent this a threshold of 0.25m/s is imposed.
-           ztmp0 = MAX( 0.25 , U_zu/(1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - zpsi_m_u)) ) !  U_n10
-           ztmp0 = cd_neutral_10m(ztmp0)                                                 ! Cd_n10
-           sqrt_Cd_n10 = sqrt(ztmp0)
-       
-           Ce_n10  = 1.e-3 * (34.6 * sqrt_Cd_n10)                     ! L&Y 2004 eq. (6b)
-           stab    = 0.5 + sign(0.5,zeta_u)                           ! update stability
-           Ch_n10  = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab))  ! L&Y 2004 eq. (6c-6d)
-
-           !! Update of transfer coefficients:
-           ztmp1 = 1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - zpsi_m_u)   ! L&Y 2004 eq. (10a)
-           Cd      = ztmp0 / ( ztmp1*ztmp1 )   
-           sqrt_Cd = SQRT( Cd )
-         ENDIF
-         !
-         ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10
-         ztmp2 = sqrt_Cd / sqrt_Cd_n10
-         ztmp1 = 1. + Ch_n10*ztmp0               
-         Ch  = Ch_n10*ztmp2 / ztmp1  ! L&Y 2004 eq. (10b)
-         !
-         ztmp1 = 1. + Ce_n10*ztmp0               
-         Ce  = Ce_n10*ztmp2 / ztmp1  ! L&Y 2004 eq. (10c)
-         !
-      END DO
-
-      CALL wrk_dealloc( jpi,jpj, U_zu, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd )
-      CALL wrk_dealloc( jpi,jpj, zeta_u, stab )
-      CALL wrk_dealloc( jpi,jpj, zpsi_h_u, zpsi_m_u, ztmp0, ztmp1, ztmp2 )
-
-      IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t )
-
-      IF( nn_timing == 1 )  CALL timing_stop('turb_core_2z')
-      !
-   END SUBROUTINE turb_core_2z
-
-
-   FUNCTION cd_neutral_10m( zw10 )
-      !!----------------------------------------------------------------------
-      !! Estimate of the neutral drag coefficient at 10m as a function 
-      !! of neutral wind  speed at 10m
-      !!
-      !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b)
-      !!
-      !! Author: L. Brodeau, june 2014
-      !!----------------------------------------------------------------------    
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   zw10           ! scalar wind speed at 10m (m/s)
-      REAL(wp), DIMENSION(jpi,jpj)             ::   cd_neutral_10m
-      !
-      REAL(wp), DIMENSION(:,:), POINTER ::   rgt33
-      !!----------------------------------------------------------------------    
-      !
-      CALL wrk_alloc( jpi,jpj, rgt33 )
-      !
-      !! When wind speed > 33 m/s => Cyclone conditions => special treatment
-      rgt33 = 0.5_wp + SIGN( 0.5_wp, (zw10 - 33._wp) )   ! If zw10 < 33. => 0, else => 1  
-      cd_neutral_10m = 1.e-3 * ( &
-         &       (1._wp - rgt33)*( 2.7_wp/zw10 + 0.142_wp + zw10/13.09_wp - 3.14807E-10*zw10**6) & ! zw10< 33.
-         &      + rgt33         *      2.34   )                                                    ! zw10 >= 33.
-      !
-      CALL wrk_dealloc( jpi,jpj, rgt33)
-      !
-   END FUNCTION cd_neutral_10m
-
-
-   FUNCTION psi_m(pta)   !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
-      !-------------------------------------------------------------------------------
-      ! universal profile stability function for momentum
-      !-------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta
-      !
-      REAL(wp), DIMENSION(jpi,jpj)             :: psi_m
-      REAL(wp), DIMENSION(:,:), POINTER        :: X2, X, stabit
-      !-------------------------------------------------------------------------------
-      !
-      CALL wrk_alloc( jpi,jpj, X2, X, stabit )
-      !
-      X2 = SQRT( ABS( 1. - 16.*pta ) )  ;  X2 = MAX( X2 , 1. )   ;   X = SQRT( X2 )
-      stabit = 0.5 + SIGN( 0.5 , pta )
-      psi_m = -5.*pta*stabit  &                                                          ! Stable
-         &    + (1. - stabit)*(2.*LOG((1. + X)*0.5) + LOG((1. + X2)*0.5) - 2.*ATAN(X) + rpi*0.5)  ! Unstable
-      !
-      CALL wrk_dealloc( jpi,jpj, X2, X, stabit )
-      !
-   END FUNCTION psi_m
-
-
-   FUNCTION psi_h( pta )    !! Psis, L&Y 2004 eq. (8c), (8d), (8e)
-      !-------------------------------------------------------------------------------
-      ! universal profile stability function for temperature and humidity
-      !-------------------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pta
-      !
-      REAL(wp), DIMENSION(jpi,jpj)             ::   psi_h
-      REAL(wp), DIMENSION(:,:), POINTER        ::   X2, X, stabit
-      !-------------------------------------------------------------------------------
-      !
-      CALL wrk_alloc( jpi,jpj, X2, X, stabit )
-      !
-      X2 = SQRT( ABS( 1. - 16.*pta ) )   ;   X2 = MAX( X2 , 1. )   ;   X = SQRT( X2 )
-      stabit = 0.5 + SIGN( 0.5 , pta )
-      psi_h = -5.*pta*stabit   &                                       ! Stable
-         &    + (1. - stabit)*(2.*LOG( (1. + X2)*0.5 ))                ! Unstable
-      !
-      CALL wrk_dealloc( jpi,jpj, X2, X, stabit )
-      !
-   END FUNCTION psi_h
-
-   !!======================================================================
-END MODULE sbcblk_core
Index: anches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90	(revision 7279)
+++ 	(revision )
@@ -1,644 +1,0 @@
-MODULE sbcblk_mfs
-   !!======================================================================
-   !!                       ***  MODULE  sbcblk_mfs  ***
-   !! Ocean forcing:  momentum, heat and freshwater flux formulation
-   !!=====================================================================
-   !! History :  3.3  !   2010-05 (P. Oddo) Original Code
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!   sbc_blk_mfs   : bulk formulation as ocean surface boundary condition
-   !!                   (forced mode, mfs bulk formulae)
-   !!   blk_oce_mfs   : ocean: computes momentum, heat and freshwater fluxes
-   !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and tracers
-   USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants
-   USE fldread        ! read input fields
-   USE sbc_oce        ! Surface boundary condition: ocean fields
-   USE sbcwave  ,ONLY :   cdn_wave !wave module
-   !
-   USE iom            ! I/O manager library
-   USE in_out_manager ! I/O manager
-   USE lib_mpp        ! distribued memory computing library
-   USE wrk_nemo       ! work arrays
-   USE timing         ! Timing
-   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE prtctl         ! Print control
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   sbc_blk_mfs       ! routine called in sbcmod module
-      
-   INTEGER , PARAMETER ::   jpfld   = 7         ! maximum number of files to read 
-   INTEGER , PARAMETER ::   jp_wndi = 1         ! index of 10m wind velocity (i-component) (m/s) at T-point
-   INTEGER , PARAMETER ::   jp_wndj = 2         ! index of 10m wind velocity (j-component) (m/s) at T-point
-   INTEGER , PARAMETER ::   jp_clc  = 3         ! index of total cloud cover               ( % )
-   INTEGER , PARAMETER ::   jp_msl  = 4         ! index of mean sea level pressure         (Pa)
-   INTEGER , PARAMETER ::   jp_tair = 5         ! index of 10m air temperature             (Kelvin)
-   INTEGER , PARAMETER ::   jp_rhm  = 6         ! index of dew point temperature           (Kelvin)
-   INTEGER , PARAMETER ::   jp_prec = 7         ! index of total precipitation (rain+snow) (Kg/m2/s)
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf ! structure of input fields (file informations, fields read)
-         
-   !! * Substitutions
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 
-   !! $Id$
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE sbc_blk_mfs( kt )
-      !!---------------------------------------------------------------------
-      !!                    ***  ROUTINE sbc_blk_mfs  ***
-      !!                   
-      !! ** Purpose :   provide at each time step the surface ocean fluxes
-      !!      (momentum, heat, freshwater, runoff is added later in the code) 
-      !!
-      !! ** Method  : (1) READ Atmospheric data from NetCDF files:
-      !!      the 10m wind velocity (i-component) (m/s) at T-point
-      !!      the 10m wind velocity (j-component) (m/s) at T-point
-      !!      the 2m Dew point Temperature        (k)
-      !!      the Cloud COver                     (%)
-      !!      the 2m air temperature              (Kelvin)
-      !!      the Mean Sea Level Preesure         (hPa)
-      !!      the Climatological Precipitation    (kg/m2/s)
-      !!              (2) CALL blk_oce_mfs
-      !!
-      !!      Computes:
-      !!      Solar Radiation using Reed formula (1975, 1977)
-      !!      Net Long wave radiation using Bignami et al. (1995)
-      !!      Latent and Sensible heat using Kondo (1975)
-      !!      Drag coeff using Hllerman and Rosenstein (1983)
-      !!      C A U T I O N : never mask the surface stress fields
-      !!                      the stress is assumed to be in the mesh referential
-      !!                      i.e. the (i,j) referential
-      !!
-      !! ** Action  :   defined at each time-step at the air-sea interface
-      !!              - utau, vtau  i- and j-component of the wind stress
-      !!              - taum        wind stress module at T-point
-      !!              - wndm        10m wind module at T-point over free ocean or leads in presence of sea-ice
-      !!              - qns, qsr    non-slor and solar heat flux
-      !!              - emp         evaporation minus precipitation
-      !!----------------------------------------------------------------------
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  sh_now   ! specific humidity at T-point 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  catm     ! Cover 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  alonl    ! Lon 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  alatl    ! Lat 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  gsst     ! SST 
-      !!---------------------------------------------------------------------
-      !! Local fluxes variables
-      !!---------------------------------------------------------------------
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  qbw     ! Net Long wave 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ha      ! Sesnible 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  elat    ! Latent 
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  evap    ! evaporation rate 
-
-      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
-      !!
-      INTEGER  :: ierror                          ! return error code
-      INTEGER  :: ifpr     ! dummy loop indice
-      INTEGER  :: jj,ji    ! dummy loop arguments
-      INTEGER  ::   ios    ! Local integer output status for namelist read
-      REAL(wp) :: act_hour
-      !!--------------------------------------------------------------------
-      !! Variables for specific humidity computation
-      !!--------------------------------------------------------------------
-      REAL(wp) :: onsea,par1,par2
-      DATA onsea,par1,par2 / 0.98, 640380., -5107.4 /
-      !!                      par1 [Kg/m3], par2 [K]
-
-      CHARACTER(len=100) ::  cn_dir                           ! Root directory for location of Atmospheric forcing files
-      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                ! array of namelist informations on the fields to read
-      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_clc, sn_msl       ! informations about the fields to be read
-      TYPE(FLD_N) ::   sn_tair , sn_rhm, sn_prec              !   "                                 "
-      !!---------------------------------------------------------------------
-      NAMELIST/namsbc_mfs/ cn_dir ,                                          &
-         &                  sn_wndi , sn_wndj, sn_clc   , sn_msl ,           &
-         &                  sn_tair , sn_rhm , sn_prec 
-      !!---------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('sbc_blk_mfs')
-      !
-      !                                         ! ====================== !
-      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
-         !                                      ! ====================== !
-         ALLOCATE( sh_now(jpi,jpj), catm(jpi,jpj), alonl(jpi,jpj), alatl(jpi,jpj),     &
-         &        gsst(jpi,jpj),  qbw(jpi,jpj),    ha(jpi,jpj),  elat(jpi,jpj),     &
-         &        evap(jpi,jpj), STAT=ierror )
-
-         IF( ierror /= 0 )   CALL ctl_warn('sbc_blk_mfs: failed to allocate arrays')
-
-         REWIND( numnam_ref )              ! Namelist namsbc_msf in reference namelist : MFS files
-         READ  ( numnam_ref, namsbc_mfs, IOSTAT = ios, ERR = 901)
-901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in reference namelist', lwp )
-
-         REWIND( numnam_cfg )              ! Namelist namsbc_msf in configuration namelist : MFS files
-         READ  ( numnam_cfg, namsbc_mfs, IOSTAT = ios, ERR = 902 )
-902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in configuration namelist', lwp )
-         IF(lwm) WRITE ( numond, namsbc_mfs )
-         !
-         ! store namelist information in an array
-         slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj
-         slf_i(jp_clc ) = sn_clc    ;   slf_i(jp_msl ) = sn_msl
-         slf_i(jp_tair) = sn_tair   ;   slf_i(jp_rhm)  = sn_rhm
-         slf_i(jp_prec) = sn_prec   ;  
-         !
-         ALLOCATE( sf(jpfld), STAT=ierror )         ! set sf structure
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_blk_mfs: unable to allocate sf structure' )   ;   RETURN
-         ENDIF
-         DO ifpr= 1, jpfld
-            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
-            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
-         END DO
-         ! fill sf with slf_i and control print
-         CALL fld_fill( sf, slf_i, cn_dir,'sbc_blk_mfs','bulk formulation for ocean SBC', 'namsbc_mfs' )
-            !
-      ENDIF
-
-         CALL fld_read( kt, nn_fsbc, sf )                   ! input fields provided at the current time-step
-
-         catm(:,:)   = 0.0    ! initializze cloud cover variable
-         sh_now(:,:) = 0.0    ! initializze specifif humidity variable
-
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-
-         ! Calculate Specific Humidity 
-         !-------------------------------------------------
-            sh_now(ji,jj) = (1/1.22) * onsea * par1 * EXP(par2/sf(jp_rhm)%fnow(ji,jj,1))
-
-         ! Normalize Clouds
-         !-------------------------------------------------
-            catm(ji,jj)   = max(0.0,min(1.0,sf(jp_clc)%fnow(ji,jj,1)*0.01))
-
-            END DO
-         END DO
-
-         ! wind module at 10m 
-         !--------------------------------------------------
-         wndm(:,:) = SQRT(  sf(jp_wndi)%fnow(:,:,1) * sf(jp_wndi)%fnow(:,:,1)   &
-              &             + sf(jp_wndj)%fnow(:,:,1) * sf(jp_wndj)%fnow(:,:,1)  )
-
-         ! Some conv for fluxes computation
-         !-------------------------------------------------
-         alonl(:,:) = glamt(:,:) * rad
-         alatl(:,:) = gphit(:,:) * rad
-         gsst(:,:)  = tsn(:,:,1,jp_tem)  * tmask(:,:,1)
-
-         IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
-
-         ! Force to zero the output of fluxes 
-         !-------------------------------------------------
-          qsr(:,:)  = 0.0 ; qbw(:,:)  = 0.0 ; 
-          ha(:,:)   = 0.0 ; elat(:,:) = 0.0 ; 
-          evap(:,:) = 0.0 ; utau(:,:) = 0.0 ; 
-          vtau(:,:) = 0.0
-
-          CALL lbc_lnk( sf(jp_wndi)%fnow(:,:,1), 'T', -1. )
-          CALL lbc_lnk( sf(jp_wndj)%fnow(:,:,1), 'T', -1. )
-
-          act_hour = (( nsec_year / rday ) - INT (nsec_year / rday)) * rjjhh
-
-          CALL fluxes_mfs(alatl,alonl,act_hour,                                &     ! input static
-                            gsst(:,:),sf(jp_tair)%fnow(:,:,1),sh_now(:,:),     &     ! input dynamic
-                            sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),  &     ! input dynamic
-                            sf(jp_msl)%fnow(:,:,1) , catm(:,:) ,               &     ! input dynamic
-                            qsr,qbw,ha,elat,evap,utau,vtau)                          ! output
-
-         ! Shortwave radiation
-         !--------------------------------------------------
-          qsr(:,:) = qsr(:,:) * tmask(:,:,1)
-
-         ! total non solar heat flux over water
-         !--------------------------------------------------
-          qns(:,:) = -1. * ( qbw(:,:) + ha(:,:) + elat(:,:) )
-          qns(:,:) = qns(:,:)*tmask(:,:,1)
-
-         ! mask the wind module at 10m 
-         !--------------------------------------------------
-          wndm(:,:) = wndm(:,:) * tmask(:,:,1)
-
-         !   wind stress module (taum) into T-grid
-         !--------------------------------------------------
-          taum(:,:) = SQRT( utau(:,:) * utau(:,:) + vtau(:,:) * vtau(:,:) ) * tmask(:,:,1)
-
-          CALL lbc_lnk( taum, 'T', 1. )
-
-         ! Interpolate utau, vtau into the grid_V and grid_V
-         !-------------------------------------------------
-      !     Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines
-      !     Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves
-         DO jj = 1, jpjm1
-            DO ji = 1, fs_jpim1
-               utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( utau(ji,jj) * tmask(ji,jj,1) &
-               &                                + utau(ji+1,jj) * tmask(ji+1,jj,1) )        &
-               &                 * MAX(tmask(ji,jj,1),tmask(ji+1,jj  ,1))
-               vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( vtau(ji,jj) * tmask(ji,jj,1) &
-               &                                + vtau(ji,jj+1) * tmask(ji,jj+1,1) )        &
-               &                 * MAX(tmask(ji,jj,1),tmask(ji  ,jj+1,1))
-            END DO
-         END DO
-
-         CALL lbc_lnk( utau(:,:), 'U', -1. )
-         CALL lbc_lnk( vtau(:,:), 'V', -1. )
-
-         ! for basin budget and cooerence
-         !--------------------------------------------------
-         emp(:,:) = evap(:,:) - sf(jp_prec)%fnow(:,:,1) * tmask(:,:,1)
-
-         CALL iom_put( "qlw_oce",   qbw  )                 ! output downward longwave heat over the ocean
-         CALL iom_put( "qsb_oce", - ha   )                 ! output downward sensible heat over the ocean
-         CALL iom_put( "qla_oce", - elat )                 ! output downward latent   heat over the ocean
-         CALL iom_put( "qns_oce",   qns  )                 ! output downward non solar heat over the ocean
-
-      ENDIF
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('sbc_blk_mfs')
-      !
-   END SUBROUTINE sbc_blk_mfs
-  
- 
-   SUBROUTINE fluxes_mfs(alat,alon,hour,                               &
-        sst,tnow,shnow,unow,vnow,mslnow,cldnow,qsw,qbw,ha,elat,        &
-        evap,taux,tauy)
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE fluxes_mfs  ***
-      !!
-      !! --- it provides SURFACE HEAT and MOMENTUM FLUXES in MKS :
-      !!
-      !!  1)   Water flux (WFLUX)                 [ watt/m*m ]
-      !!  2)   Short wave flux (QSW)              [ watt/m*m ] Reed 1977
-      !!  3)   Long wave flux backward (QBW)      [ watt/m*m ]
-      !!  4)   Latent heat of evaporation (ELAT)  [ watt/m*m ]
-      !!  5)   Sensible heat flux   (HA)          [ watt/m*m ]
-      !!  6)   Wind stress x-component   (TAUX)   [ newton/m*m ]
-      !!  7)   Wind stress y-component   (TAUY)   [ newton/m*m ]
-      !!
-      !!----------------------------------------------------------------------
-      USE sbcblk_core, ONLY: turb_core_2z ! For wave coupling and Tair/rh from 2 to 10m
-
-      REAL(wp), INTENT(in   ) :: hour
-      REAL(wp), INTENT(in   ), DIMENSION (:,:) :: sst, unow, alat , alon
-      REAL(wp), INTENT(in   ), DIMENSION (:,:) :: vnow, cldnow, mslnow
-      REAL(wp), INTENT(out  ), DIMENSION (:,:) :: qsw, qbw, ha, elat
-      REAL(wp), INTENT(out  ), DIMENSION (:,:) :: evap,taux,tauy
-      REAL(wp), INTENT(inout), DIMENSION (:,:) :: tnow , shnow
-
-      INTEGER :: ji,jj 
-      REAL(wp)  :: wair, vtnow, ea, deltemp, s, stp , fh , fe
-      REAL(wp)  :: esre, cseep
-
-      REAL(wp), DIMENSION (:,:), POINTER ::   rspeed, sh10now, t10now, cdx, ce, shms
-      REAL(wp), DIMENSION (:,:), POINTER ::   rhom, sstk, ch, rel_windu, rel_windv
-      !!----------------------------------------------------------------------
-      !!     coefficients ( in MKS )  :
-      !!----------------------------------------------------------------------
-
-      REAL(wp), PARAMETER ::  ps = 1013.    ! --- surface air pressure
-      REAL(wp), PARAMETER ::  expsi=0.622   ! --- expsi
-      REAL(wp), PARAMETER ::  rd=287.       ! --- dry air gas constant
-      REAL(wp), PARAMETER ::  cp=1005.      ! --- specific heat capacity
-      REAL(wp), PARAMETER ::  onsea=0.98    ! --- specific humidity factors
-      REAL(wp), PARAMETER ::  par1=640380.  ! [Kg/m3]
-      REAL(wp), PARAMETER ::  par2=-5107.4  ! [K]
-
-      !---------------------------------------------------------------------
-      !--- define Kondo parameters
-      !---------------------------------------------------------------------
-
-      REAL(wp), DIMENSION(5) :: a_h = (/0.0,0.927,1.15,1.17,1.652/)
-      REAL(wp), DIMENSION(5) :: a_e = (/0.0,0.969,1.18,1.196,1.68/)
-      REAL(wp), DIMENSION(5) :: b_h = (/1.185,0.0546,0.01,0.0075,-0.017/)
-      REAL(wp), DIMENSION(5) :: b_e = (/1.23,0.0521,0.01,0.008,-0.016/)
-      REAL(wp), DIMENSION(5) :: c_h = (/0.0,0.0,0.0,-0.00045,0.0/)
-      REAL(wp), DIMENSION(5) :: c_e = (/0.0,0.0,0.0,-0.0004,0.0/)
-      REAL(wp), DIMENSION(5) :: p_h = (/-0.157,1.0,1.0,1.0,1.0/)
-      REAL(wp), DIMENSION(5) :: p_e = (/-0.16,1.0,1.0,1.0,1.0/)
-      INTEGER :: kku                        !index varing with wind speed
-      !
-      IF( nn_timing == 1 )  CALL timing_start('fluxes_mfs')
-      !
-      CALL wrk_alloc( jpi,jpj, rspeed, sh10now, t10now, cdx, ce, shms )
-      CALL wrk_alloc( jpi,jpj, rhom, sstk, ch, rel_windu, rel_windv )
-
-      !!----------------------------------------------------------------------
-      !! ------------------ (i)      short wave
-      !!----------------------------------------------------------------------
-
-       CALL qshort(hour,alat,alon,cldnow,qsw)
-
-          rel_windu(:,:) = 0.0_wp
-          rel_windv(:,:) = 0.0_wp
-
-       DO jj = 2, jpj
-          DO ji = fs_2, jpi
-           rel_windu(ji,jj) = unow(ji,jj) - 0.5_wp * ( ssu_m(ji-1,jj) + ssu_m(ji,jj) )
-           rel_windv(ji,jj) = vnow(ji,jj) - 0.5_wp * ( ssv_m(ji,jj-1) + ssv_m(ji,jj) )
-          END DO
-       END DO
-
-       rspeed(:,:)= SQRT(rel_windu(:,:)*rel_windu(:,:)   &
-         &                   + rel_windv(:,:)*rel_windv(:,:)) 
-
-       sstk(:,:) = sst(:,:) + rtt                          !- SST data in Kelvin degrees
-       shms(:,:) = (1/1.22)*onsea*par1*EXP(par2/sstk(:,:)) !- Saturation Specific Humidity
-
-      ! --- Transport temperature and humidity from 2m to 10m
-      !----------------------------------------------------------------------
-
-      t10now(:,:) = 0.0           ;   sh10now(:,:)= 0.0
-      ! Note that air temp is converted in potential temp
-      CALL turb_core_2z(2.,10.,sstk,tnow+2*0.0098,shms,shnow,rspeed,        &
-         &              Cdx,Ch,Ce,t10now,sh10now )
-      tnow(:,:)  = t10now(:,:)    ;    shnow(:,:) = sh10now(:,:)
-
-      !!----------------------------------------------------------------------
-      !! ------------------ (ii)    net long wave
-      !!----------------------------------------------------------------------
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            wair = shnow(ji,jj) / (1 - shnow(ji,jj))    ! mixing ratio of the air (Wallace and Hobbs)
-            vtnow = (tnow(ji,jj)*(expsi+wair))/(expsi*(1.+wair))   ! virtual temperature of air
-            rhom(ji,jj) = 100.*(ps/rd)/vtnow                       ! density of the moist air
-            ea   = (wair  / (wair  + 0.622 )) * mslnow(ji,jj)
-
-            qbw(ji,jj) = emic*stefan*( sstk(ji,jj)**4. )                    &
-                 - ( stefan*( tnow(ji,jj)**4. ) * ( 0.653 + 0.00535*ea ) )  &
-                   * ( 1. + 0.1762*( cldnow(ji,jj)**2. ) )
-
-         END DO
-      END DO
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-      !!----------------------------------------------------------------------
-      !! ------------------ (iii)   sensible heat
-      !!----------------------------------------------------------------------
-
-      !! --- calculates the term :      ( Ts - Ta )
-      !!----------------------------------------------------------------------
-            deltemp = sstk(ji,jj) - tnow (ji,jj)
-
-      !!----------------------------------------------------------------------
-      !! --- variable turbulent exchange coefficients ( from Kondo 1975 )
-      !! --- calculate the Neutral Transfer Coefficent using an empiric formula
-      !! --- by Kondo et al. Then it applies the diabatic approximation.
-      !!----------------------------------------------------------------------
-
-            s = deltemp/(wndm(ji,jj)**2.)   !! --- calculate S 
-            stp = s*abs(s)/(abs(s)+0.01)    !! --- calculate the Stability Parameter 
-
-      !!----------------------------------------------------------------------
-      !! --- for stable condition (sst-t_air < 0):
-      !!----------------------------------------------------------------------
-
-            IF (s.lt.0. .and. ((stp.gt.-3.3).and.(stp.lt.0.))) THEN
-                fh = 0.1_wp+0.03_wp*stp+0.9_wp*exp(4.8_wp*stp)
-                fe = fh
-            ELSE IF (s.lt.0. .and. stp.le.-3.3) THEN
-                fh = 0._wp
-                fe = fh
-            ELSE                                       ! --- for unstable condition 
-                fh = 1.0_wp+0.63_wp*sqrt(stp)
-                fe = fh
-            ENDIF
-
-      !!----------------------------------------------------------------------
-      !! --- calculate the coefficient CH,CE,CD
-      !!----------------------------------------------------------------------
-
-            IF (wndm(ji,jj) >= 0. .AND. wndm(ji,jj) <= 2.2)       THEN
-                kku=1
-            ELSE IF (wndm(ji,jj) > 2.2 .AND. wndm(ji,jj) <= 5.0)  THEN
-                kku=2
-            ELSE IF (wndm(ji,jj) > 5.0 .AND. wndm(ji,jj) <= 8.0)  THEN
-                kku=3
-            ELSE IF (wndm(ji,jj) > 8.0 .AND. wndm(ji,jj) <= 25.0) THEN
-                kku=4
-            ELSE IF (wndm(ji,jj) > 25.0 )                         THEN
-                kku=5
-            ENDIF
-
-            ch(ji,jj) = ( a_h(kku) + b_h(kku) * wndm(ji,jj) ** p_h(kku)      &
-                        + c_h(kku) * (wndm(ji,jj)-8 ) **2) * fh
-
-            ce(ji,jj) = ( a_e(kku) + b_e(kku) * wndm(ji,jj) ** p_e(kku)      &
-                        + c_e(kku) * (wndm(ji,jj)-8 ) **2) * fe
-
-            ch(ji,jj) = ch(ji,jj) / 1000.0
-            ce(ji,jj) = ce(ji,jj) / 1000.0
-
-            IF (wndm(ji,jj)<0.3) THEN
-               ch(ji,jj) = 1.3e-03 * fh
-               ce(ji,jj) = 1.5e-03 * fe
-            ELSE IF(wndm(ji,jj)>50.0) THEN
-               ch(ji,jj) = 1.25e-03 * fh
-               ce(ji,jj) = 1.30e-03 * fe
-            ENDIF
-
-      !!----------------------------------------------------------------------
-      !! --- calculates the SENSIBLE HEAT FLUX in MKS ( watt/m*m )
-      !!----------------------------------------------------------------------
-
-            HA(ji,jj) = rhom(ji,jj)*cp*ch(ji,jj)*wndm(ji,jj)*deltemp
-
-      !!----------------------------------------------------------------------
-      !! ------------------ (iv)  latent heat
-      !! --- calculates the LATENT HEAT FLUX  ( watt/m*m )
-      !! --- ELAT = L*rho*Ce*|V|*[qs(Ts)-qa(t2d)]
-      !!----------------------------------------------------------------------
-
-            esre  = shms(ji,jj) - shnow(ji,jj)   ! --- calculates the term : qs(Ta)-qa(t2d)
-
-            cseep = ce(ji,jj) * wndm(ji,jj) * esre     ! --- calculates the term : Ce*|V|*[qs(Ts)-qa(t2d)]
-
-            evap(ji,jj) = (cseep * rhom(ji,jj))  ! in [kg/m2/sec] !! --- calculates the EVAPORATION RATE [m/yr]
-
-            elat(ji,jj) = rhom(ji,jj) * cseep * heatlat(sst(ji,jj))
-
-      !!----------------------------------------------------------------------
-      !! --- calculates the Drag Coefficient
-      !!----------------------------------------------------------------------
-
-      !!----------------------------------------------------------------------
-      !! --- deltemp should be (Ts - Ta) in the formula estimating
-      !! --- drag coefficient
-      !!----------------------------------------------------------------------
-
-              IF( .NOT. ln_cdgw ) THEN
-                 cdx(ji,jj) = cd_HR(wndm(ji,jj),deltemp)
-              ENDIF
-
-          END DO
-      END DO
-
-      !!----------------------------------------------------------------------
-      !! --- calculates the wind stresses in MKS ( newton/m*m )
-      !! ---            taux= rho*Cd*|V|u      tauy= rho*Cd*|V|v
-      !!----------------------------------------------------------------------
-
-       taux(:,:)= rhom(:,:) * cdx(:,:) * rspeed(:,:) * rel_windu(:,:)
-       tauy(:,:)= rhom(:,:) * cdx(:,:) * rspeed(:,:) * rel_windv(:,:)
-
-      CALL wrk_dealloc( jpi,jpj, rspeed, sh10now, t10now, cdx, ce, shms )
-      CALL wrk_dealloc( jpi,jpj, rhom, sstk, ch, rel_windu, rel_windv )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('fluxes_mfs')
-      !
-   END SUBROUTINE fluxes_mfs
-
-
-      REAL(wp) FUNCTION cd_HR(speed,delt)
-      !!----------------------------------------------------------------------
-      !! --- calculates the Drag Coefficient as a function of the abs. value
-      !! --- of the wind velocity ( Hellermann and Rosenstein )
-      !!----------------------------------------------------------------------
-
-       REAL(wp), INTENT(in) :: speed,delt
-       REAL(wp), PARAMETER  :: a1=0.934e-3 , a2=0.788e-4, a3=0.868e-4     
-       REAL(wp), PARAMETER  :: a4=-0.616e-6, a5=-.120e-5, a6=-.214e-5
-
-        cd_HR = a1 + a2*speed + a3*delt + a4*speed*speed        &
-           + a5*delt*delt  + a6*speed*delt
-
-      END FUNCTION cd_HR
-
-      REAL(wp) function HEATLAT(t)
-      !!----------------------------------------------------------------------
-      !! --- calculates the Latent Heat of Vaporization ( J/kg ) as function of
-      !! --- the temperature ( Celsius degrees )
-      !! --- ( from A. Gill  pag. 607 )
-      !!
-      !! --- Constant Latent Heat of Vaporization ( Rosati,Miyakoda 1988 )
-      !!     L = 2.501e+6  (MKS)
-      !!----------------------------------------------------------------------
-
-      REAL(wp) , intent(in) :: t
-
-      heatlat = 2.5008e+6 -2.3e+3*t
-
-      END FUNCTION HEATLAT
-
-
-   SUBROUTINE qshort(hour,alat,alon,cldnow,qsw)
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE qshort  ***
-      !!
-      !! ** Purpose :   Compute Solar Radiation
-      !!
-      !! ** Method  :   Compute Solar Radiation according Astronomical
-      !!                formulae
-      !!
-      !! References :   Reed RK (1975) and Reed RK (1977)
-      !!
-      !! Note: alat,alon - (lat, lon)  in radians
-      !!----------------------------------------------------------------------
-        REAL(wp), INTENT (in) :: hour
-
-        REAL(wp), INTENT(in ), DIMENSION(:,:) :: alat,alon
-        REAL(wp), INTENT(in ), DIMENSION(:,:) :: cldnow
-        REAL(wp), INTENT(out), DIMENSION(:,:) :: qsw
-        REAL(wp), DIMENSION(12) :: alpham
-
-        REAL(wp), PARAMETER ::   eclips=23.439* (3.141592653589793_wp / 180._wp)
-        REAL(wp), PARAMETER ::   solar = 1350.
-        REAL(wp), PARAMETER ::   tau = 0.7
-        REAL(wp), PARAMETER ::   aozone = 0.09
-        REAL(wp), PARAMETER ::   yrdays = 360.
-        REAL(wp) :: days, th0,th02,th03, sundec, thsun, coszen, qatten
-        REAL(wp) :: qzer, qdir,qdiff,qtot,tjul,sunbet
-        REAL(wp) :: albedo
-        INTEGER :: jj, ji
-
-      !!----------------------------------------------------------------------
-      !! --- albedo monthly values from Payne (1972) as means of the values
-      !! --- at 40N and 30N for the Atlantic Ocean ( hence the same latitudinal
-      !! --- band of the Mediterranean Sea ) :
-      !!----------------------------------------------------------------------
-
-        data alpham /0.095,0.08,0.065,0.065,0.06,0.06,0.06,0.06,        &
-                    0.065,0.075,0.09,0.10/
-
-      !!----------------------------------------------------------------------
-      !!   days is the number of days elapsed until the day=nday_year
-      !!----------------------------------------------------------------------
-        days = nday_year -1.
-        th0  = 2.*rpi*days/yrdays
-        th02 = 2.*th0
-        th03 = 3.*th0
-
-      !! --- sun declination :
-      !!----------------------------------------------------------------------
-        sundec = 0.006918 - 0.399912*cos(th0) + 0.070257*sin(th0) -   &
-                          0.006758*cos(th02) + 0.000907*sin(th02) -   &
-                          0.002697*cos(th03) + 0.001480*sin(th03)
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-
-      !! --- sun hour angle :
-      !!----------------------------------------------------------------------
-          thsun = (hour -12.)*15.*rad + alon(ji,jj)
-
-      !! --- cosine of the solar zenith angle :
-      !!----------------------------------------------------------------------
-          coszen =sin(alat(ji,jj))*sin(sundec)                 &
-                    +cos(alat(ji,jj))*cos(sundec)*cos(thsun)
-
-          IF(coszen .LE. 5.035D-04) THEN
-            coszen = 0.0
-            qatten = 0.0
-          ELSE
-            qatten = tau**(1./coszen)
-          END IF
-
-          qzer  = coszen * solar *                                 &
-                  (1.0+1.67E-2*cos(rpi*2.*(days-3.0)/365.0))**2
-          qdir  = qzer * qatten
-          qdiff = ((1.-aozone)*qzer - qdir) * 0.5
-          qtot  =  qdir + qdiff
-          tjul = (days -81.)*rad
-
-      !! --- sin of the solar noon altitude in radians :
-      !!----------------------------------------------------------------------
-          sunbet=sin(alat(ji,jj))*sin(eclips*sin(tjul)) +   &
-                 cos(alat(ji,jj))*cos(eclips*sin(tjul))
-
-      !! --- solar noon altitude in degrees :
-      !!----------------------------------------------------------------------
-
-         sunbet = asin(sunbet)/rad
-
-      !!----------------------------------------------------------------------
-      !! --- calculates the albedo according to Payne (1972)
-      !!----------------------------------------------------------------------
-
-         albedo = alpham(nmonth)
-
-      !!----------------------------------------------------------------------
-      !! --- ( radiation as from Reed(1977), Simpson and Paulson(1979) )
-      !! --- calculates SHORT WAVE FLUX ( watt/m*m )
-      !! --- ( Rosati,Miyakoda 1988 ; eq. 3.8 )
-      !!----------------------------------------------------------------------
-
-          IF(cldnow(ji,jj).LT.0.3) THEN
-             qsw(ji,jj) = qtot * (1.-albedo)
-          ELSE
-             qsw(ji,jj) = qtot*(1.-0.62*cldnow(ji,jj)              &
-                                + .0019*sunbet)*(1.-albedo)
-          ENDIF
-
-         END DO
-      END DO
-
-   END SUBROUTINE qshort
-
-
-   !!======================================================================
-
-END MODULE sbcblk_mfs
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 7280)
@@ -24,5 +24,5 @@
    USE sbc_oce         ! Surface boundary condition: ocean fields
    USE sbc_ice         ! Surface boundary condition: ice   fields
-   USE sbcblk_core     ! Surface boundary condition: CORE bulk
+   USE sbcblk          ! Surface boundary condition: bulk
    USE sbccpl
 
@@ -191,5 +191,5 @@
             CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=F and calc_Tsfc=F in ice_in' )
          ENDIF
-      ELSEIF (ksbc == jp_core) THEN
+      ELSEIF (ksbc == jp_blk) THEN
          IF ( .NOT. (calc_strair .AND. calc_Tsfc) ) THEN
             CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=T and calc_Tsfc=T in ice_in' )
@@ -392,7 +392,7 @@
          ENDDO
 
-      ELSE IF (ksbc == jp_core) THEN
-
-! Pass CORE forcing fields to CICE (which will calculate heat fluxes etc itself)
+      ELSE IF (ksbc == jp_blk) THEN
+
+! Pass bulk forcing fields to CICE (which will calculate heat fluxes etc itself)
 ! x comp and y comp of atmosphere surface wind (CICE expects on T points)
          ztmp(:,:) = wndi_ice(:,:)
@@ -585,5 +585,5 @@
 ! Better to use evap and tprecip? (but for now don't read in evap in this case)
          emp(:,:)  = emp(:,:)+fr_i(:,:)*(tprecip(:,:)-sprecip(:,:))
-      ELSE IF (ksbc == jp_core) THEN
+      ELSE IF (ksbc == jp_blk) THEN
          emp(:,:)  = (1.0-fr_i(:,:))*emp(:,:)        
       ELSE IF (ksbc == jp_purecpl) THEN
@@ -618,5 +618,5 @@
 ! Scale qsr and qns according to ice fraction (bulk formulae only)
 
-      IF (ksbc == jp_core) THEN
+      IF (ksbc == jp_blk) THEN
          qsr(:,:)=qsr(:,:)*(1.0-fr_i(:,:))
          qns(:,:)=qns(:,:)*(1.0-fr_i(:,:))
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 7280)
@@ -13,4 +13,5 @@
    !!             -   ! 2012-10  (C. Rousset)  add lim_diahsb
    !!            3.6  ! 2014-07  (M. Vancoppenolle, G. Madec, O. Marti) revise coupled interface
+   !!            4.0  ! 2016-06  (L. Brodeau) new unified bulk routine (based on AeroBulk)
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -28,6 +29,5 @@
    USE sbc_oce         ! Surface boundary condition: ocean fields
    USE sbc_ice         ! Surface boundary condition: ice   fields
-   USE sbcblk_core     ! Surface boundary condition: CORE bulk
-   USE sbcblk_clio     ! Surface boundary condition: CLIO bulk
+   USE sbcblk          ! Surface boundary condition: bulk
    USE sbccpl          ! Surface boundary condition: coupled interface
    USE albedo          ! ocean & ice albedo
@@ -47,5 +47,5 @@
    USE limupdate2      ! update of global variables
    USE limvar          ! Ice variables switch
-   USE limctl          ! 
+   USE limctl          !
    USE limmsh          ! LIM mesh
    USE limistate       ! LIM initial state
@@ -56,5 +56,5 @@
    USE iom             ! I/O manager library
    USE prtctl          ! Print control
-   USE lib_fortran     ! 
+   USE lib_fortran     !
    USE lbclnk          ! lateral boundary condition - MPP link
    USE lib_mpp         ! MPP library
@@ -62,5 +62,5 @@
    USE timing          ! Timing
 
-#if defined key_bdy 
+#if defined key_bdy
    USE bdyice_lim       ! unstructured open boundary data  (bdy_ice_lim routine)
 #endif
@@ -71,5 +71,5 @@
    PUBLIC sbc_ice_lim  ! routine called by sbcmod.F90
    PUBLIC sbc_lim_init ! routine called by sbcmod.F90
-   
+
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
@@ -84,27 +84,27 @@
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE sbc_ice_lim  ***
-      !!                   
-      !! ** Purpose :   update the ocean surface boundary condition via the 
-      !!                Louvain la Neuve Sea Ice Model time stepping 
+      !!
+      !! ** Purpose :   update the ocean surface boundary condition via the
+      !!                Louvain la Neuve Sea Ice Model time stepping
       !!
       !! ** Method  :   ice model time stepping
-      !!              - call the ice dynamics routine 
-      !!              - call the ice advection/diffusion routine 
-      !!              - call the ice thermodynamics routine 
-      !!              - call the routine that computes mass and 
+      !!              - call the ice dynamics routine
+      !!              - call the ice advection/diffusion routine
+      !!              - call the ice thermodynamics routine
+      !!              - call the routine that computes mass and
       !!                heat fluxes at the ice/ocean interface
-      !!              - save the outputs 
+      !!              - save the outputs
       !!              - save the outputs for restart when necessary
       !!
       !! ** Action  : - time evolution of the LIM sea-ice model
       !!              - update all sbc variables below sea-ice:
-      !!                utau, vtau, taum, wndm, qns , qsr, emp , sfx 
+      !!                utau, vtau, taum, wndm, qns , qsr, emp , sfx
       !!---------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt      ! ocean time step
-      INTEGER, INTENT(in) ::   kblk    ! type of bulk (=3 CLIO, =4 CORE, =5 COUPLED)
+      INTEGER, INTENT(in) ::   kblk    ! type of bulk (=4 BULK, =5 COUPLED)
       !!
       INTEGER  ::    jl                 ! dummy loop index
       REAL(wp), POINTER, DIMENSION(:,:,:)   ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky
-      REAL(wp), POINTER, DIMENSION(:,:  )   ::   zutau_ice, zvtau_ice 
+      REAL(wp), POINTER, DIMENSION(:,:  )   ::   zutau_ice, zvtau_ice
       !!----------------------------------------------------------------------
 
@@ -119,16 +119,16 @@
          u_oce(:,:) = ssu_m(:,:) * umask(:,:,1)
          v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1)
-         
+
          ! masked sea surface freezing temperature [Kelvin] (set to rt0 over land)
          CALL eos_fzp( sss_m(:,:) , t_bo(:,:) )
          t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) )
-          
+
          ! Mask sea ice surface temperature (set to rt0 over land)
          DO jl = 1, jpl
             t_su(:,:,jl) = t_su(:,:,jl) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) )
-         END DO     
-         !
-         !------------------------------------------------!                                           
-         ! --- Dynamical coupling with the atmosphere --- !                                           
+         END DO
+         !
+         !------------------------------------------------!
+         ! --- Dynamical coupling with the atmosphere --- !
          !------------------------------------------------!
          ! It provides the following fields:
@@ -136,9 +136,8 @@
          !-----------------------------------------------------------------
          SELECT CASE( kblk )
-         CASE( jp_clio    )   ;   CALL blk_ice_clio_tau                         ! CLIO bulk formulation            
-         CASE( jp_core    )   ;   CALL blk_ice_core_tau                         ! CORE bulk formulation
+         CASE( jp_blk     )   ;   CALL blk_ice_tau                              ! Bulk formulation
          CASE( jp_purecpl )   ;   CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled   formulation
          END SELECT
-         
+
          IF( ln_mixcpl) THEN   ! Case of a mixed Bulk/Coupled formulation
             CALL wrk_alloc( jpi,jpj    , zutau_ice, zvtau_ice)
@@ -153,5 +152,5 @@
          !-------------------------------------------------------!
          numit = numit + nn_fsbc                  ! Ice model time step
-         !                                                   
+         !
          CALL sbc_lim_bef                         ! Store previous ice values
          CALL sbc_lim_diag0                       ! set diag of mass, heat and salt fluxes to 0
@@ -160,5 +159,5 @@
          IF( .NOT. lk_c1d ) THEN
             !
-            CALL lim_dyn( kt )                    ! Ice dynamics    ( rheology/dynamics )   
+            CALL lim_dyn( kt )                    ! Ice dynamics    ( rheology/dynamics )
             !
             CALL lim_trp( kt )                    ! Ice transport   ( Advection/diffusion )
@@ -167,5 +166,5 @@
             !
 #if defined key_bdy
-            CALL bdy_ice_lim( kt )                ! bdy ice thermo 
+            CALL bdy_ice_lim( kt )                ! bdy ice thermo
             IF( ln_icectl )       CALL lim_prt( kt, iiceprt, jiceprt, 1, ' - ice thermo bdy - ' )
 #endif
@@ -174,14 +173,14 @@
             !
          ENDIF
-         
+
          ! previous lead fraction and ice volume for flux calculations
-         CALL sbc_lim_bef                        
+         CALL sbc_lim_bef
          CALL lim_var_glo2eqv                     ! ht_i and ht_s for ice albedo calculation
-         CALL lim_var_agg(1)                      ! at_i for coupling (via pfrld) 
+         CALL lim_var_agg(1)                      ! at_i for coupling (via pfrld)
          pfrld(:,:)   = 1._wp - at_i(:,:)
          phicif(:,:)  = vt_i(:,:)
-         
-         !------------------------------------------------------!                                           
-         ! --- Thermodynamical coupling with the atmosphere --- !                                           
+
+         !------------------------------------------------------!
+         ! --- Thermodynamical coupling with the atmosphere --- !
          !------------------------------------------------------!
          ! It provides the following fields:
@@ -196,14 +195,8 @@
 
          SELECT CASE( kblk )
-         CASE( jp_clio )                                       ! CLIO bulk formulation
-            ! In CLIO the cloud fraction is read in the climatology and the all-sky albedo 
-            ! (alb_ice) is computed within the bulk routine
-                                 CALL blk_ice_clio_flx( t_su, zalb_cs, zalb_os, alb_ice )
-            IF( ln_mixcpl      ) CALL sbc_cpl_ice_flx( p_frld=pfrld, palbi=alb_ice, psst=sst_m, pist=t_su )
-            IF( nn_limflx /= 2 ) CALL ice_lim_flx( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_limflx )
-         CASE( jp_core )                                       ! CORE bulk formulation
+         CASE( jp_blk )                                       ! bulk formulation
             ! albedo depends on cloud fraction because of non-linear spectral effects
             alb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
-                                 CALL blk_ice_core_flx( t_su, alb_ice )
+                                 CALL blk_ice_flx( t_su, alb_ice )
             IF( ln_mixcpl      ) CALL sbc_cpl_ice_flx( p_frld=pfrld, palbi=alb_ice, psst=sst_m, pist=t_su )
             IF( nn_limflx /= 2 ) CALL ice_lim_flx( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_limflx )
@@ -219,5 +212,5 @@
          ! --- ice thermodynamics --- !
          !----------------------------!
-         CALL lim_thd( kt )                         ! Ice thermodynamics      
+         CALL lim_thd( kt )                         ! Ice thermodynamics
          !
          CALL lim_update2( kt )                     ! Corrections
@@ -225,12 +218,12 @@
          CALL lim_sbc_flx( kt )                     ! Update surface ocean mass, heat and salt fluxes
          !
-         IF(ln_limdiaout) CALL lim_diahsb           ! Diagnostics and outputs 
-         !
-         CALL lim_wri( 1 )                          ! Ice outputs 
+         IF(ln_limdiaout) CALL lim_diahsb           ! Diagnostics and outputs
+         !
+         CALL lim_wri( 1 )                          ! Ice outputs
          !
          IF( kt == nit000 .AND. ln_rstart )   &
             &             CALL iom_close( numrir )  ! close input ice restart file
          !
-         IF( lrst_ice )   CALL lim_rst_write( kt )  ! Ice restart file 
+         IF( lrst_ice )   CALL lim_rst_write( kt )  ! Ice restart file
          !
          IF( ln_icectl )  CALL lim_ctl( kt )        ! alerts in case of model crash
@@ -248,5 +241,5 @@
       !
    END SUBROUTINE sbc_ice_lim
-   
+
 
    SUBROUTINE sbc_lim_init
@@ -259,13 +252,13 @@
       !!----------------------------------------------------------------------
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition' 
+      IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition'
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   via Louvain la Neuve Ice Model (LIM-3) time stepping'
       !
-      !                                ! Open the reference and configuration namelist files and namelist output file 
-      CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
+      !                                ! Open the reference and configuration namelist files and namelist output file
+      CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
       CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
       IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )
       !
-      CALL ice_run                     ! set some ice run parameters
+      CALL lim_run_init                ! set some ice run parameters
       !
       !                                ! Allocate the ice arrays
@@ -308,5 +301,5 @@
       CALL lim_var_glo2eqv
       !
-      CALL lim_sbc_init                 ! ice surface boundary condition   
+      CALL lim_sbc_init                 ! ice surface boundary condition
       !
       fr_i(:,:)     = at_i(:,:)         ! initialisation of sea-ice fraction
@@ -318,10 +311,10 @@
             ELSE                             ;  rn_amax_2d(ji,jj) = rn_amax_s  ! SH
             ENDIF
-        ENDDO
-      ENDDO 
-      !
-      nstart = numit  + nn_fsbc      
-      nitrun = nitend - nit000 + 1 
-      nlast  = numit  + nitrun 
+         END DO
+      END DO
+      !
+      nstart = numit  + nn_fsbc
+      nitrun = nitend - nit000 + 1
+      nlast  = numit  + nitrun
       !
       IF( nstock == 0 )   nstock = nlast + 1
@@ -330,11 +323,11 @@
 
 
-   SUBROUTINE ice_run
+   SUBROUTINE lim_run_init
       !!-------------------------------------------------------------------
-      !!                  ***  ROUTINE ice_run ***
-      !!                 
+      !!                  ***  ROUTINE lim_run_init ***
+      !!
       !! ** Purpose :   Definition some run parameter for ice model
       !!
-      !! ** Method  :   Read the namicerun namelist and check the parameter 
+      !! ** Method  :   Read the namicerun namelist and check the parameter
       !!              values called at the first timestep (nit000)
       !!
@@ -343,7 +336,7 @@
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       NAMELIST/namicerun/ jpl, nlay_i, nlay_s, cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir,  &
-         &                ln_limdyn, rn_amax_n, rn_amax_s, ln_limdiahsb, ln_limdiaout, ln_icectl, iiceprt, jiceprt  
+         &                ln_limdyn, rn_amax_n, rn_amax_s, ln_limdiahsb, ln_limdiaout, ln_icectl, iiceprt, jiceprt
       !!-------------------------------------------------------------------
-      !                    
+      !
       REWIND( numnam_ice_ref )              ! Namelist namicerun in reference namelist : Parameters for ice
       READ  ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901)
@@ -357,22 +350,23 @@
       IF(lwp) THEN                        ! control print
          WRITE(numout,*)
-         WRITE(numout,*) 'ice_run : ice share parameters for dynamics/advection/thermo of sea-ice'
-         WRITE(numout,*) ' ~~~~~~'
-         WRITE(numout,*) '   number of ice  categories                               = ', jpl
-         WRITE(numout,*) '   number of ice  layers                                   = ', nlay_i
-         WRITE(numout,*) '   number of snow layers                                   = ', nlay_s
-         WRITE(numout,*) '   switch for ice dynamics (1) or not (0)      ln_limdyn   = ', ln_limdyn
-         WRITE(numout,*) '   maximum ice concentration for NH                        = ', rn_amax_n 
-         WRITE(numout,*) '   maximum ice concentration for SH                        = ', rn_amax_s
-         WRITE(numout,*) '   Diagnose heat/salt budget or not          ln_limdiahsb  = ', ln_limdiahsb
-         WRITE(numout,*) '   Output   heat/salt budget or not          ln_limdiaout  = ', ln_limdiaout
-         WRITE(numout,*) '   control prints in ocean.out for (i,j)=(iiceprt,jiceprt) = ', ln_icectl
-         WRITE(numout,*) '   i-index for control prints (ln_icectl=true)             = ', iiceprt
-         WRITE(numout,*) '   j-index for control prints (ln_icectl=true)             = ', jiceprt
+         WRITE(numout,*) 'lim_run_init : ice share parameters for dynamics/advection/thermo of sea-ice'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namicerun'
+         WRITE(numout,*) '      number of ice  categories                               = ', jpl
+         WRITE(numout,*) '      number of ice  layers                                   = ', nlay_i
+         WRITE(numout,*) '      number of snow layers                                   = ', nlay_s
+         WRITE(numout,*) '      switch for ice dynamics (1) or not (0)      ln_limdyn   = ', ln_limdyn
+         WRITE(numout,*) '      maximum ice concentration for NH                        = ', rn_amax_n
+         WRITE(numout,*) '      maximum ice concentration for SH                        = ', rn_amax_s
+         WRITE(numout,*) '      Diagnose heat/salt budget or not          ln_limdiahsb  = ', ln_limdiahsb
+         WRITE(numout,*) '      Output   heat/salt budget or not          ln_limdiaout  = ', ln_limdiaout
+         WRITE(numout,*) '      control prints in ocean.out for (i,j)=(iiceprt,jiceprt) = ', ln_icectl
+         WRITE(numout,*) '      i-index for control prints (ln_icectl=true)             = ', iiceprt
+         WRITE(numout,*) '      j-index for control prints (ln_icectl=true)             = ', jiceprt
       ENDIF
       !
       ! sea-ice timestep and inverse
-      rdt_ice   = nn_fsbc * rdt  
-      r1_rdtice = 1._wp / rdt_ice 
+      rdt_ice   = nn_fsbc * rdt
+      r1_rdtice = 1._wp / rdt_ice
 
       ! inverse of nlay_i and nlay_s
@@ -384,5 +378,5 @@
 #endif
       !
-   END SUBROUTINE ice_run
+   END SUBROUTINE lim_run_init
 
 
@@ -414,16 +408,14 @@
       IF(lwp) THEN                        ! control print
          WRITE(numout,*)
-         WRITE(numout,*) 'ice_itd : ice cat distribution'
-         WRITE(numout,*) ' ~~~~~~'
-         WRITE(numout,*) '   shape of ice categories distribution                     nn_catbnd = ', nn_catbnd
-         WRITE(numout,*) '   mean ice thickness in the domain (used if nn_catbnd=2)   rn_himean = ', rn_himean
+         WRITE(numout,*) 'lim_itd_init : Initialization of ice cat distribution '
+         WRITE(numout,*) '~~~~~~~~~~~~'
+         WRITE(numout,*) '   Namelist namiceitd'
+         WRITE(numout,*) '      shape of ice categories distribution                     nn_catbnd = ', nn_catbnd
+         WRITE(numout,*) '      mean ice thickness in the domain (used if nn_catbnd=2)   rn_himean = ', rn_himean
       ENDIF
       !
       !----------------------------------
-      !- Thickness categories boundaries 
+      !- Thickness categories boundaries
       !----------------------------------
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'lim_itd_init : Initialization of ice cat distribution '
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
       !
       hi_max(:) = 0._wp
@@ -443,5 +435,5 @@
          zalpha = 0.05_wp
          zhmax  = 3._wp * rn_himean
-         DO jl = 1, jpl 
+         DO jl = 1, jpl
             znum = jpl * ( zhmax+1 )**zalpha
             zden = REAL( jpl-jl , wp ) * ( zhmax + 1._wp )**zalpha + REAL( jl , wp )
@@ -457,25 +449,26 @@
       hi_max(jpl) = 99._wp          ! set to a big value to ensure that all ice is thinner than hi_max(jpl)
       !
-      IF(lwp) WRITE(numout,*) ' Thickness category boundaries '
-      IF(lwp) WRITE(numout,*) ' hi_max ', hi_max(0:jpl)
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '      Thickness category boundaries '
+      IF(lwp) WRITE(numout,*) '         hi_max ', hi_max(0:jpl)
       !
    END SUBROUTINE lim_itd_init
 
-   
+
    SUBROUTINE ice_lim_flx( ptn_ice , palb_ice, pqns_ice ,    &
       &                    pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_limflx )
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE ice_lim_flx  ***
-      !!                   
+      !!
       !! ** Purpose :   update the ice surface boundary condition by averaging and / or
-      !!                redistributing fluxes on ice categories                   
-      !!
-      !! ** Method  :   average then redistribute 
-      !!
-      !! ** Action  :   
+      !!                redistributing fluxes on ice categories
+      !!
+      !! ** Method  :   average then redistribute
+      !!
+      !! ** Action  :
       !!---------------------------------------------------------------------
-      INTEGER                   , INTENT(in   ) ::   k_limflx   ! =-1 do nothing; =0 average ; 
-      !                                                         ! =1 average and redistribute ; =2 redistribute
-      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature 
+      INTEGER                   , INTENT(in   ) ::   k_limflx   ! =-1 do nothing; =0 average ;
+      !                                                         ! = 1 average and redistribute ; =2 redistribute
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature
       REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb_ice   ! ice albedo
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqns_ice   ! non solar flux
@@ -526,10 +519,10 @@
          CALL wrk_alloc( jpi,jpj, zalb_m, ztem_m )
          !
-         zalb_m(:,:) = fice_ice_ave ( palb_ice (:,:,:) ) 
-         ztem_m(:,:) = fice_ice_ave ( ptn_ice  (:,:,:) ) 
+         zalb_m(:,:) = fice_ice_ave ( palb_ice (:,:,:) )
+         ztem_m(:,:) = fice_ice_ave ( ptn_ice  (:,:,:) )
          DO jl = 1, jpl
             pqns_ice (:,:,jl) = pqns_ice (:,:,jl) + pdqn_ice  (:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
             pevap_ice(:,:,jl) = pevap_ice(:,:,jl) + pdevap_ice(:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
-            pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) ) 
+            pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) )
          END DO
          !
@@ -546,10 +539,10 @@
       !!                  ***  ROUTINE sbc_lim_bef  ***
       !!
-      !! ** purpose :  store ice variables at "before" time step 
+      !! ** purpose :  store ice variables at "before" time step
       !!----------------------------------------------------------------------
       a_i_b  (:,:,:)   = a_i  (:,:,:)     ! ice area
       e_i_b  (:,:,:,:) = e_i  (:,:,:,:)   ! ice thermal energy
       v_i_b  (:,:,:)   = v_i  (:,:,:)     ! ice volume
-      v_s_b  (:,:,:)   = v_s  (:,:,:)     ! snow volume 
+      v_s_b  (:,:,:)   = v_s  (:,:,:)     ! snow volume
       e_s_b  (:,:,:,:) = e_s  (:,:,:,:)   ! snow thermal energy
       smv_i_b(:,:,:)   = smv_i(:,:,:)     ! salt content
@@ -557,5 +550,5 @@
       u_ice_b(:,:)     = u_ice(:,:)
       v_ice_b(:,:)     = v_ice(:,:)
-      !      
+      !
    END SUBROUTINE sbc_lim_bef
 
@@ -569,5 +562,5 @@
       !!----------------------------------------------------------------------
       sfx    (:,:) = 0._wp   ;
-      sfx_bri(:,:) = 0._wp   ; 
+      sfx_bri(:,:) = 0._wp   ;
       sfx_sni(:,:) = 0._wp   ;   sfx_opw(:,:) = 0._wp
       sfx_bog(:,:) = 0._wp   ;   sfx_dyn(:,:) = 0._wp
@@ -580,12 +573,12 @@
       wfx_bom(:,:) = 0._wp   ;   wfx_sum(:,:) = 0._wp
       wfx_res(:,:) = 0._wp   ;   wfx_sub(:,:) = 0._wp
-      wfx_spr(:,:) = 0._wp   ;   
-      !
-      hfx_thd(:,:) = 0._wp   ;   
+      wfx_spr(:,:) = 0._wp   ;
+      !
+      hfx_thd(:,:) = 0._wp   ;
       hfx_snw(:,:) = 0._wp   ;   hfx_opw(:,:) = 0._wp
       hfx_bog(:,:) = 0._wp   ;   hfx_dyn(:,:) = 0._wp
       hfx_bom(:,:) = 0._wp   ;   hfx_sum(:,:) = 0._wp
       hfx_res(:,:) = 0._wp   ;   hfx_sub(:,:) = 0._wp
-      hfx_spr(:,:) = 0._wp   ;   hfx_dif(:,:) = 0._wp 
+      hfx_spr(:,:) = 0._wp   ;   hfx_dif(:,:) = 0._wp
       hfx_err(:,:) = 0._wp   ;   hfx_err_rem(:,:) = 0._wp
       hfx_err_dif(:,:) = 0._wp
@@ -595,10 +588,10 @@
       afx_dyn(:,:) = 0._wp   ;   afx_thd(:,:) = 0._wp
       !
-      diag_heat(:,:) = 0._wp ;   diag_smvi(:,:) = 0._wp ;
-      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp ;
+      diag_heat(:,:) = 0._wp ;   diag_smvi(:,:) = 0._wp
+      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp
       !
    END SUBROUTINE sbc_lim_diag0
 
-     
+
    FUNCTION fice_cell_ave ( ptab )
       !!--------------------------------------------------------------------------
@@ -608,13 +601,13 @@
       REAL (wp), DIMENSION (jpi,jpj,jpl), INTENT (in) :: ptab
       INTEGER :: jl ! Dummy loop index
-      
-      fice_cell_ave (:,:) = 0.0_wp
+
+      fice_cell_ave (:,:) = 0._wp
       DO jl = 1, jpl
          fice_cell_ave (:,:) = fice_cell_ave (:,:) + a_i (:,:,jl) * ptab (:,:,jl)
       END DO
-      
+
    END FUNCTION fice_cell_ave
-   
-   
+
+
    FUNCTION fice_ice_ave ( ptab )
       !!--------------------------------------------------------------------------
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 7280)
@@ -24,6 +24,5 @@
    USE sbc_oce          ! Surface boundary condition: ocean fields
    USE sbc_ice          ! Surface boundary condition: ice   fields
-   USE sbcblk_core      ! Surface boundary condition: CORE bulk
-   USE sbcblk_clio      ! Surface boundary condition: CLIO bulk
+   USE sbcblk           ! Surface boundary condition: bulk
    USE sbccpl           ! Surface boundary condition: coupled interface
    USE albedo
@@ -93,5 +92,5 @@
       !!---------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt      ! ocean time step
-      INTEGER, INTENT(in) ::   ksbc    ! type of sbc ( =3 CLIO bulk ; =4 CORE bulk ; =5 coupled )
+      INTEGER, INTENT(in) ::   ksbc    ! type of sbc ( =4 bulk ; =5 coupled )
       !!
       INTEGER  ::   ji, jj   ! dummy loop indices
@@ -161,10 +160,8 @@
 
          SELECT CASE( ksbc )
-         CASE( jp_core , jp_purecpl )   ! CORE and COUPLED bulk formulations
+         CASE( jp_blk , jp_purecpl )   ! BULK and COUPLED bulk formulations
 
             ! albedo depends on cloud fraction because of non-linear spectral effects
             zalb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
-            ! In CLIO the cloud fraction is read in the climatology and the all-sky albedo 
-            ! (zalb_ice) is computed within the bulk routine
 
          END SELECT
@@ -184,19 +181,12 @@
          !
          SELECT CASE( ksbc )
-         CASE( jp_clio )           ! CLIO bulk formulation
-!           CALL blk_ice_clio( zsist, zalb_cs    , zalb_os    , zalb_ice   ,            &
-!              &                      utau_ice   , vtau_ice   , qns_ice    , qsr_ice,   &
-!              &                      qla_ice    , dqns_ice   , dqla_ice   ,            &
-!              &                      tprecip    , sprecip    ,                         &
-!              &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  )
-            CALL blk_ice_clio_tau
-            CALL blk_ice_clio_flx( zsist, zalb_cs, zalb_os, zalb_ice )
-
-         CASE( jp_core )           ! CORE bulk formulation
-            CALL blk_ice_core_tau
-            CALL blk_ice_core_flx( zsist, zalb_ice )
-
+         !
+         CASE( jp_blk )           ! Bulk formulation
+            CALL blk_ice_tau
+            CALL blk_ice_flx( zsist, zalb_ice )
+            !
          CASE( jp_purecpl )            ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics)
             CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )
+            !
          END SELECT
          
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 7280)
@@ -13,5 +13,6 @@
    !!            3.4  ! 2011-11  (C. Harris) CICE added as an option
    !!            3.5  ! 2012-11  (A. Coward, G. Madec) Rethink of heat, mass and salt surface fluxes
-   !!            3.6  ! 2014-11  (P. Mathiot, C. Harris) add ice shelves melting                    
+   !!            3.6  ! 2014-11  (P. Mathiot, C. Harris) add ice shelves melting
+   !!            4.0  ! 2016-06  (L. Brodeau) new general bulk formulation
    !!----------------------------------------------------------------------
 
@@ -30,12 +31,10 @@
    USE sbcssm         ! surface boundary condition: sea-surface mean variables
    USE sbcflx         ! surface boundary condition: flux formulation
-   USE sbcblk_clio    ! surface boundary condition: bulk formulation : CLIO
-   USE sbcblk_core    ! surface boundary condition: bulk formulation : CORE
-   USE sbcblk_mfs     ! surface boundary condition: bulk formulation : MFS
+   USE sbcblk         ! surface boundary condition: bulk formulation
    USE sbcice_if      ! surface boundary condition: ice-if sea-ice model
    USE sbcice_lim     ! surface boundary condition: LIM 3.0 sea-ice model
    USE sbcice_lim_2   ! surface boundary condition: LIM 2.0 sea-ice model
    USE sbcice_cice    ! surface boundary condition: CICE    sea-ice model
-   USE sbccpl         ! surface boundary condition: coupled florulation
+   USE sbccpl         ! surface boundary condition: coupled formulation
    USE cpl_oasis3     ! OASIS routines for coupling
    USE sbcssr         ! surface boundary condition: sea surface restoring
@@ -63,7 +62,7 @@
    PUBLIC   sbc        ! routine called by step.F90
    PUBLIC   sbc_init   ! routine called by opa.F90
-   
+
    INTEGER ::   nsbc   ! type of surface boundary condition (deduced from namsbc informations)
-      
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO-consortium (2016) 
@@ -85,16 +84,15 @@
       !!              - nsbc: type of sbc
       !!----------------------------------------------------------------------
-      INTEGER ::   icpt   ! local integer
-      !!
-      NAMELIST/namsbc/ nn_fsbc  , ln_usr   , ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs,   &
-         &             ln_cpl   , ln_mixcpl, nn_components      , nn_limflx  ,               &
-         &             ln_traqsr, ln_dm2dc ,                                                 &  
-         &             nn_ice   , nn_ice_embd,                                               &
-         &             ln_rnf   , ln_ssr   , ln_isf   , nn_fwb    , ln_apr_dyn,              &
-         &             ln_wave  ,                                                            &
-         &             nn_lsm   
-      INTEGER  ::   ios
-      INTEGER  ::   ierr, ierr0, ierr1, ierr2, ierr3, jpm
-      LOGICAL  ::   ll_purecpl
+      INTEGER ::   ios, icpt                         ! local integer
+      LOGICAL ::   ll_purecpl, ll_opa, ll_not_nemo   ! local logical
+      !!
+      NAMELIST/namsbc/ nn_fsbc  ,                                                    &
+         &             ln_usr   , ln_flx   , ln_blk       ,                          &
+         &             ln_cpl   , ln_mixcpl, nn_components, nn_limflx,               &
+         &             nn_ice   , nn_ice_embd,                                       &
+         &             ln_traqsr, ln_dm2dc ,                                         &
+         &             ln_rnf   , nn_fwb   , ln_ssr       , ln_isf   , ln_apr_dyn,   &
+         &             ln_wave  ,                                                    &
+         &             nn_lsm
       !!----------------------------------------------------------------------
       !
@@ -105,41 +103,41 @@
       ENDIF
       !
-      REWIND( numnam_ref )       ! Namelist namsbc in reference namelist : Surface boundary
+      !                       !**  read Surface Module namelist
+      REWIND( numnam_ref )          !* Namelist namsbc in reference namelist : Surface boundary
       READ  ( numnam_ref, namsbc, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in reference namelist', lwp )
       !
-      REWIND( numnam_cfg )       ! Namelist namsbc in configuration namelist : Parameters of the run
+      REWIND( numnam_cfg )          !* Namelist namsbc in configuration namelist : Parameters of the run
       READ  ( numnam_cfg, namsbc, IOSTAT = ios, ERR = 902 )
 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in configuration namelist', lwp )
       IF(lwm) WRITE( numond, namsbc )
       !
-      !                          ! overwrite namelist parameter using CPP key information
+      !                             !* overwrite namelist parameter using CPP key information
       IF( Agrif_Root() ) THEN                ! AGRIF zoom
-        IF( lk_lim2 )   nn_ice      = 2
-        IF( lk_lim3 )   nn_ice      = 3
-        IF( lk_cice )   nn_ice      = 4
-      ENDIF
-      !
-      IF(lwp) THEN               ! Control print
+         IF( lk_lim2 )   nn_ice      = 2
+         IF( lk_lim3 )   nn_ice      = 3
+         IF( lk_cice )   nn_ice      = 4
+      ENDIF
+      !
+      IF(lwp) THEN                  !* Control print
          WRITE(numout,*) '   Namelist namsbc (partly overwritten with CPP key setting)'
-         WRITE(numout,*) '      Frequency update of sbc (and ice)             nn_fsbc       = ', nn_fsbc
+         WRITE(numout,*) '      frequency update of sbc (and ice)             nn_fsbc       = ', nn_fsbc
          WRITE(numout,*) '      Type of air-sea fluxes : '
          WRITE(numout,*) '         user defined formulation                   ln_usr        = ', ln_usr
          WRITE(numout,*) '         flux         formulation                   ln_flx        = ', ln_flx
-         WRITE(numout,*) '         CLIO bulk    formulation                   ln_blk_clio   = ', ln_blk_clio
-         WRITE(numout,*) '         CORE bulk    formulation                   ln_blk_core   = ', ln_blk_core
-         WRITE(numout,*) '         MFS  bulk    formulation                   ln_blk_mfs    = ', ln_blk_mfs
+         WRITE(numout,*) '         bulk         formulation                   ln_blk        = ', ln_blk
          WRITE(numout,*) '      Type of coupling (Ocean/Ice/Atmosphere) : '
          WRITE(numout,*) '         ocean-atmosphere coupled formulation       ln_cpl        = ', ln_cpl
-         WRITE(numout,*) '         forced-coupled mixed formulation           ln_mixcpl     = ', ln_mixcpl
+         WRITE(numout,*) '         mixed forced-coupled     formulation       ln_mixcpl     = ', ln_mixcpl
+!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist 
          WRITE(numout,*) '         OASIS coupling (with atm or sas)           lk_oasis      = ', lk_oasis
          WRITE(numout,*) '         components of your executable              nn_components = ', nn_components
          WRITE(numout,*) '         Multicategory heat flux formulation (LIM3) nn_limflx     = ', nn_limflx
          WRITE(numout,*) '      Sea-ice : '
-         WRITE(numout,*) '         ice management in the sbc (=0/1/2/3)       nn_ice        = ', nn_ice 
+         WRITE(numout,*) '         ice management in the sbc (=0/1/2/3)       nn_ice        = ', nn_ice
          WRITE(numout,*) '         ice-ocean embedded/levitating (=0/1/2)     nn_ice_embd   = ', nn_ice_embd
          WRITE(numout,*) '      Misc. options of sbc : '
          WRITE(numout,*) '         Light penetration in temperature Eq.       ln_traqsr     = ', ln_traqsr
-         WRITE(numout,*) '            daily mean to diurnal cycle qsr            ln_dm2dc   = ', ln_dm2dc 
+         WRITE(numout,*) '            daily mean to diurnal cycle qsr            ln_dm2dc   = ', ln_dm2dc
          WRITE(numout,*) '         Sea Surface Restoring on SST and/or SSS    ln_ssr        = ', ln_ssr
          WRITE(numout,*) '         FreshWater Budget control  (=0/1/2)        nn_fwb        = ', nn_fwb
@@ -149,5 +147,5 @@
          WRITE(numout,*) '         closed sea (=0/1) (set in namdom)          nn_closea     = ', nn_closea
          WRITE(numout,*) '         nb of iterations if land-sea-mask applied  nn_lsm        = ', nn_lsm
-         WRITE(numout,*) '         surface wave                               ln_wave       = ', ln_wave  
+         WRITE(numout,*) '         surface wave                               ln_wave       = ', ln_wave
       ENDIF
       !
@@ -157,104 +155,133 @@
          IF( MOD( rdt  , 2.  ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           )
       ENDIF
-      !
-      IF(lwp) THEN
-         WRITE(numout,*)
-         SELECT CASE ( nn_limflx )        ! LIM3 Multi-category heat flux formulation
-         CASE ( -1 )   ;   WRITE(numout,*) '   LIM3: use per-category fluxes (nn_limflx = -1) '
-         CASE (  0 )   ;   WRITE(numout,*) '   LIM3: use average per-category fluxes (nn_limflx = 0) ' 
-         CASE (  1 )   ;   WRITE(numout,*) '   LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) '
-         CASE (  2 )   ;   WRITE(numout,*) '   LIM3: Redistribute a single flux over categories (nn_limflx = 2) '
+      !                       !**  check option consistency
+      !
+      IF(lwp) WRITE(numout,*)       !* Single / Multi - executable (NEMO / OPA+SAS) 
+      SELECT CASE( nn_components )
+      CASE( jp_iam_nemo )
+         IF(lwp) WRITE(numout,*) '   NEMO configured as a single executable (i.e. including both OPA and Surface module'
+      CASE( jp_iam_opa  )
+         IF(lwp) WRITE(numout,*) '   Multi executable configuration. Here, OPA component'
+         IF( .NOT.lk_oasis )   CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but key_oasis3 disabled' )
+         IF( ln_cpl        )   CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but ln_cpl = T in OPA'   )
+         IF( ln_mixcpl     )   CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl = T in OPA' )
+      CASE( jp_iam_sas  )
+         IF(lwp) WRITE(numout,*) '   Multi executable configuration. Here, SAS component'
+         IF( .NOT.lk_oasis )   CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but key_oasis3 disabled' )
+         IF( ln_mixcpl     )   CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl = T in OPA' )
+      CASE DEFAULT
+         CALL ctl_stop( 'sbc_init : unsupported value for nn_components' )
+      END SELECT
+      !                             !* coupled options
+      IF( ln_cpl ) THEN
+         IF( .NOT. lk_oasis )   CALL ctl_stop( 'sbc_init : coupled mode with an atmosphere model (ln_cpl=T)',   &
+            &                                  '           required to defined key_oasis3' )
+      ENDIF
+      IF( ln_mixcpl ) THEN
+         IF( .NOT. lk_oasis )   CALL ctl_stop( 'sbc_init : mixed forced-coupled mode (ln_mixcpl=T) ',   &
+            &                                  '           required to defined key_oasis3' )
+         IF( .NOT.ln_cpl    )   CALL ctl_stop( 'sbc_init : mixed forced-coupled mode (ln_mixcpl=T) requires ln_cpl = T' )
+         IF( nn_components /= jp_iam_nemo )    &
+            &                   CALL ctl_stop( 'sbc_init : the mixed forced-coupled mode (ln_mixcpl=T) ',   &
+            &                                   '          not yet working with sas-opa coupling via oasis' )
+      ENDIF
+      !                             !* sea-ice
+      SELECT CASE( nn_ice )
+      CASE( 0 )                        !- no ice in the domain
+      CASE( 1 )                        !- Ice-cover climatology ("Ice-if" model)  
+      CASE( 2 )                        !- LIM2 ice model
+         IF( .NOT.( ln_blk .OR. ln_cpl ) )   CALL ctl_stop( 'sbc_init : LIM2 sea-ice model requires ln_blk or ln_cpl = T' )
+      CASE( 3 )                        !- LIM3 ice model
+         IF( .NOT.( ln_blk .OR. ln_cpl ) )   CALL ctl_stop( 'sbc_init : LIM3 sea-ice model requires ln_blk or ln_cpl = T' )
+         IF( nn_ice_embd == 0            )   CALL ctl_stop( 'sbc_init : LIM3 sea-ice models require nn_ice_embd = 1 or 2' )
+      CASE( 4 )                        !- CICE ice model
+         IF( .NOT.( ln_blk .OR. ln_cpl ) )   CALL ctl_stop( 'sbc_init : CICE sea-ice model requires ln_blk or ln_cpl = T' )
+         IF( nn_ice_embd == 0            )   CALL ctl_stop( 'sbc_init : CICE sea-ice models require nn_ice_embd = 1 or 2' )
+         IF( lk_agrif                    )   CALL ctl_stop( 'sbc_init : CICE sea-ice model not currently available with AGRIF' ) 
+      CASE DEFAULT                     !- not supported
+      END SELECT
+      !
+      IF( nn_ice == 3 ) THEN           !- LIM3 case: multi-category flux option
+         IF(lwp) WRITE(numout,*)
+         SELECT CASE( nn_limflx )         ! LIM3 Multi-category heat flux formulation
+         CASE ( -1 )
+            IF(lwp) WRITE(numout,*) '   LIM3: use per-category fluxes (nn_limflx = -1) '
+            IF( ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' )
+         CASE ( 0  )
+            IF(lwp) WRITE(numout,*) '   LIM3: use average per-category fluxes (nn_limflx = 0) '
+         CASE ( 1  )
+            IF(lwp) WRITE(numout,*) '   LIM3: use average then redistribute per-category fluxes (nn_limflx = 1) '
+            IF( ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' )
+         CASE ( 2  )
+            IF(lwp) WRITE(numout,*) '   LIM3: Redistribute a single flux over categories (nn_limflx = 2) '
+            IF( .NOT.ln_cpl )   CALL ctl_stop( 'sbc_init : the chosen nn_limflx for LIM3 in forced mode cannot be 2' )
+         CASE DEFAULT
+            CALL ctl_stop( 'sbcmod: LIM3 option, nn_limflx, should be between -1 and 2' )
          END SELECT
-      ENDIF
-      !
-      IF( nn_components /= jp_iam_nemo .AND. .NOT. lk_oasis )   &
-         &      CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but key_oasis3 disabled' )
-      IF( nn_components == jp_iam_opa .AND. ln_cpl )   &
-         &      CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but ln_cpl = T in OPA' )
-      IF( nn_components == jp_iam_opa .AND. ln_mixcpl )   &
-         &      CALL ctl_stop( 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl = T in OPA' )
-      IF( ln_cpl .AND. .NOT. lk_oasis )    &
-         &      CALL ctl_stop( 'sbc_init : OASIS-coupled atmosphere model, but key_oasis3 disabled' )
-      IF( ln_mixcpl .AND. .NOT. lk_oasis )    &
-         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires the cpp key key_oasis3' )
-      IF( ln_mixcpl .AND. .NOT. ln_cpl )    &
-         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires ln_cpl = T' )
-      IF( ln_mixcpl .AND. nn_components /= jp_iam_nemo )    &
-         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) is not yet working with sas-opa coupling via oasis' )
-
-      !                              ! allocate sbc arrays
+      ELSE                             ! other sea-ice model
+         IF( nn_limflx >= 0  )   CALL ctl_warn( 'sbc_init : multi-category flux option (nn_limflx) only available in LIM3' )
+      ENDIF
+      !
+      !                       !**  allocate and set required variables
+      !
+      !                             !* allocate sbc arrays
       IF( sbc_oce_alloc() /= 0 )   CALL ctl_stop( 'sbc_init : unable to allocate sbc_oce arrays' )
-
-      !                          ! Checks:
-      IF( .NOT. ln_isf ) THEN                      ! variable initialisation if no ice shelf 
+      !
+      IF( .NOT.ln_isf ) THEN        !* No ice-shelf in the domain : allocate and set to zero
          IF( sbc_isf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_isf arrays' )
-         fwfisf  (:,:)   = 0.0_wp ; fwfisf_b  (:,:)   = 0.0_wp
-         risf_tsc(:,:,:) = 0.0_wp ; risf_tsc_b(:,:,:) = 0.0_wp
+         fwfisf  (:,:)   = 0._wp   ;   risf_tsc  (:,:,:) = 0._wp
+         fwfisf_b(:,:)   = 0._wp   ;   risf_tsc_b(:,:,:) = 0._wp
       END IF
-      IF( nn_ice == 0 .AND. nn_components /= jp_iam_opa )   fr_i(:,:) = 0._wp    ! no ice in the domain, ice fraction is always zero
-
-      sfx(:,:) = 0._wp                             ! the salt flux due to freezing/melting will be computed (i.e. will be non-zero) 
-                                                   ! only if sea-ice is present
- 
-      fmmflx(:,:) = 0._wp                          ! freezing-melting array initialisation
-      
-      taum(:,:) = 0._wp                            ! Initialise taum for use in gls in case of reduced restart
-
-      !                                            ! restartability   
-      IF( ( nn_ice == 2 .OR. nn_ice ==3 ) .AND. .NOT.( ln_blk_clio .OR. ln_blk_core .OR. ln_cpl ) )   &
-         &   CALL ctl_stop( 'LIM sea-ice model requires a bulk formulation or coupled configuration' )
-      IF( nn_ice == 4 .AND. .NOT.( ln_blk_core .OR. ln_cpl ) )   &
-         &   CALL ctl_stop( 'CICE sea-ice model requires ln_blk_core or ln_cpl' )
-      IF( nn_ice == 4 .AND. lk_agrif )   &
-         &   CALL ctl_stop( 'CICE sea-ice model not currently available with AGRIF' )
-      IF( ( nn_ice == 3 .OR. nn_ice == 4 ) .AND. nn_ice_embd == 0 )   &
-         &   CALL ctl_stop( 'LIM3 and CICE sea-ice models require nn_ice_embd = 1 or 2' )
-      IF( ( nn_ice /= 3 ) .AND. ( nn_limflx >= 0 ) )   &
-         &   WRITE(numout,*) 'The nn_limflx>=0 option has no effect if sea ice model is not LIM3'
-      IF( ( nn_ice == 3 ) .AND. ( ln_cpl ) .AND. ( ( nn_limflx == -1 ) .OR. ( nn_limflx == 1 ) ) )   &
-         &   CALL ctl_stop( 'The chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' )
-      IF( ( nn_ice == 3 ) .AND. ( .NOT. ln_cpl ) .AND. ( nn_limflx == 2 ) )   &
-         &   CALL ctl_stop( 'The chosen nn_limflx for LIM3 in forced mode cannot be 2' )
-
-      IF( ln_dm2dc )   nday_qsr = -1   ! initialisation flag
-
-      IF( ln_dm2dc .AND. .NOT.( ln_flx .OR. ln_blk_core ) .AND. nn_components /= jp_iam_opa )   &
-         &   CALL ctl_stop( 'diurnal cycle into qsr field from daily values requires a flux or core-bulk formulation' )
-      
-      !                          ! Choice of the Surface Boudary Condition (set nsbc)
-      ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl
-      !
+      IF( nn_ice == 0 ) THEN        !* No sea-ice in the domain : ice fraction is always zero
+         IF( nn_components /= jp_iam_opa )   fr_i(:,:) = 0._wp    ! except for OPA in SAS-OPA coupled case
+      ENDIF
+      !
+      sfx   (:,:) = 0._wp           !* salt flux due to freezing/melting
+      fmmflx(:,:) = 0._wp           !* freezing minus melting flux
+
+      taum(:,:) = 0._wp             !* wind stress module (needed in GLS in case of reduced restart)
+
+      IF( ln_dm2dc ) THEN           !* daily mean to diurnal cycle
+         nday_qsr = -1   ! allow initialization at the 1st call
+         IF( .NOT.( ln_flx .OR. ln_blk ) .AND. nn_components /= jp_iam_opa )   &
+            &   CALL ctl_stop( 'qsr diurnal cycle from daily values requires a flux or bulk formulation' )
+      ENDIF
+
+      !                             !* Choice of the Surface Boudary Condition
+      !                             (set nsbc)
+      !
+      ll_purecpl  = ln_cpl .AND. .NOT.ln_mixcpl
+      ll_opa      = nn_components == jp_iam_opa
+      ll_not_nemo = nn_components /= jp_iam_nemo
       icpt = 0
+      !
       IF( ln_usr          ) THEN   ;   nsbc = jp_usr     ; icpt = icpt + 1   ;   ENDIF       ! user defined         formulation
       IF( ln_flx          ) THEN   ;   nsbc = jp_flx     ; icpt = icpt + 1   ;   ENDIF       ! flux                 formulation
-      IF( ln_blk_clio     ) THEN   ;   nsbc = jp_clio    ; icpt = icpt + 1   ;   ENDIF       ! CLIO bulk            formulation
-      IF( ln_blk_core     ) THEN   ;   nsbc = jp_core    ; icpt = icpt + 1   ;   ENDIF       ! CORE bulk            formulation
-      IF( ln_blk_mfs      ) THEN   ;   nsbc = jp_mfs     ; icpt = icpt + 1   ;   ENDIF       ! MFS  bulk            formulation
+      IF( ln_blk          ) THEN   ;   nsbc = jp_blk     ; icpt = icpt + 1   ;   ENDIF       ! bulk                 formulation
       IF( ll_purecpl      ) THEN   ;   nsbc = jp_purecpl ; icpt = icpt + 1   ;   ENDIF       ! Pure Coupled         formulation
-      IF( nn_components == jp_iam_opa )   &
-         &                  THEN   ;   nsbc = jp_none    ; icpt = icpt + 1   ;   ENDIF       ! opa coupling via SAS module
-      !
-      IF( icpt /= 1 )    CALL ctl_stop( 'sbc_init: choose ONE and only ONE sbc option' )
-      !
-      IF(lwp) THEN
+      IF( ll_opa          ) THEN   ;   nsbc = jp_none    ; icpt = icpt + 1   ;   ENDIF       ! opa coupling via SAS module
+      !
+      IF( icpt /= 1 )    CALL ctl_stop( 'sbc_init : choose ONE and only ONE sbc option' )
+      !
+      IF(lwp) THEN                     !- print the choice of surface flux formulation
          WRITE(numout,*)
          SELECT CASE( nsbc )
          CASE( jp_usr     )   ;   WRITE(numout,*) '   user defined formulation'
-         CASE( jp_flx     )   ;   WRITE(numout,*) '   flux formulation'
-         CASE( jp_clio    )   ;   WRITE(numout,*) '   CLIO bulk formulation'
-         CASE( jp_core    )   ;   WRITE(numout,*) '   CORE bulk formulation'
-         CASE( jp_purecpl )   ;   WRITE(numout,*) '   pure coupled formulation'
-         CASE( jp_mfs     )   ;   WRITE(numout,*) '   MFS Bulk formulation'
-         CASE( jp_none    )   ;   WRITE(numout,*) '   OPA coupled to SAS via oasis'
-            IF( ln_mixcpl )       WRITE(numout,*) '       + forced-coupled mixed formulation'
+         CASE( jp_flx     )   ;   WRITE(numout,*) '      ===>>   flux formulation'
+         CASE( jp_blk     )   ;   WRITE(numout,*) '      ===>>   bulk formulation'
+         CASE( jp_purecpl )   ;   WRITE(numout,*) '      ===>>   pure coupled formulation'
+!!gm abusive use of jp_none ??   ===>>> need to be check and changed by adding a jp_sas parameter
+         CASE( jp_none    )   ;   WRITE(numout,*) '      ===>>   OPA coupled to SAS via oasis'
+            IF( ln_mixcpl )       WRITE(numout,*) '                  + forced-coupled mixed formulation'
          END SELECT
-         IF( nn_components/= jp_iam_nemo )  &
-            &                     WRITE(numout,*) '       + OASIS coupled SAS'
-      ENDIF
-      !
-      IF( lk_oasis )   CALL sbc_cpl_init (nn_ice)   ! OASIS initialisation. must be done before: (1) first time step
-      !                                             !                                            (2) the use of nn_fsbc
+         IF( ll_not_nemo  )       WRITE(numout,*) '                  + OASIS coupled SAS'
+      ENDIF
+      !
+      !                             !* OASIS initialization
+      !
+      IF( lk_oasis )   CALL sbc_cpl_init( nn_ice )   ! Must be done before: (1) first time step
+      !                                              !                      (2) the use of nn_fsbc
       !     nn_fsbc initialization if OPA-SAS coupling via OASIS
-      !     sas model time step has to be declared in OASIS (mandatory) -> nn_fsbc has to be modified accordingly
+      !     SAS time-step has to be declared in OASIS (mandatory) -> nn_fsbc has to be modified accordingly
       IF( nn_components /= jp_iam_nemo ) THEN
          IF( nn_components == jp_iam_opa )   nn_fsbc = cpl_freq('O_SFLX') / NINT(rdt)
@@ -268,7 +295,8 @@
       ENDIF
       !
+      !                             !* check consistency between model timeline and nn_fsbc
       IF( MOD( nitend - nit000 + 1, nn_fsbc) /= 0 .OR.   &
-          MOD( nstock             , nn_fsbc) /= 0 ) THEN 
-         WRITE(ctmp1,*) 'experiment length (', nitend - nit000 + 1, ') or nstock (', nstock,   &
+          MOD( nstock             , nn_fsbc) /= 0 ) THEN
+         WRITE(ctmp1,*) 'sbc_init : experiment length (', nitend - nit000 + 1, ') or nstock (', nstock,   &
             &           ' is NOT a multiple of nn_fsbc (', nn_fsbc, ')'
          CALL ctl_stop( ctmp1, 'Impossible to properly do model restart' )
@@ -276,18 +304,23 @@
       !
       IF( MOD( rday, REAL(nn_fsbc, wp) * rdt ) /= 0 )   &
-         &  CALL ctl_warn( 'nn_fsbc is NOT a multiple of the number of time steps in a day' )
-      !
-      IF( ln_dm2dc .AND. ( ( NINT(rday) / ( nn_fsbc * NINT(rdt) ) )  < 8 ) )   &
-         &   CALL ctl_warn( 'diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' )
-      !
-                          CALL sbc_ssm_init               ! Sea-surface mean fields initialisation
-      !
-      IF( ln_ssr      )   CALL sbc_ssr_init               ! Sea-Surface Restoring initialisation
-      !
-                          CALL sbc_rnf_init               ! Runof initialisation
-      !
-      IF( nn_ice == 3 )   CALL sbc_lim_init               ! LIM3 initialisation
-      !
-      IF( nn_ice == 4 )   CALL cice_sbc_init( nsbc )      ! CICE initialisation
+         &  CALL ctl_warn( 'sbc_init : nn_fsbc is NOT a multiple of the number of time steps in a day' )
+      !
+      IF( ln_dm2dc .AND. NINT(rday) / ( nn_fsbc * NINT(rdt) ) < 8  )   &
+         &   CALL ctl_warn( 'sbc_init : diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' )
+      !
+   
+      !                       !**  associated modules : initialization
+      !
+                          CALL sbc_ssm_init            ! Sea-surface mean fields initialization
+      !
+      IF( ln_blk      )   CALL sbc_blk_init            ! bulk formulae initialization
+
+      IF( ln_ssr      )   CALL sbc_ssr_init            ! Sea-Surface Restoring initialization
+      !
+                          CALL sbc_rnf_init            ! Runof initialization
+      !
+      IF( nn_ice == 3 )   CALL sbc_lim_init            ! LIM3 initialization
+      !
+      IF( nn_ice == 4 )   CALL cice_sbc_init( nsbc )   ! CICE initialization
       !
    END SUBROUTINE sbc_init
@@ -297,18 +330,20 @@
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE sbc  ***
-      !!              
+      !!
       !! ** Purpose :   provide at each time-step the ocean surface boundary
       !!                condition (momentum, heat and freshwater fluxes)
       !!
-      !! ** Method  :   blah blah  to be written ????????? 
+      !! ** Method  :   blah blah  to be written ?????????
       !!                CAUTION : never mask the surface stress field (tke sbc)
       !!
-      !! ** Action  : - set the ocean surface boundary condition at before and now 
-      !!                time step, i.e.  
+      !! ** Action  : - set the ocean surface boundary condition at before and now
+      !!                time step, i.e.
       !!                utau_b, vtau_b, qns_b, qsr_b, emp_n, sfx_b, qrp_b, erp_b
       !!                utau  , vtau  , qns  , qsr  , emp  , sfx  , qrp  , erp
       !!              - updte the ice fraction : fr_i
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt       ! ocean time step
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !
+      LOGICAL ::   ll_sas, ll_opa   ! local logical
       !!---------------------------------------------------------------------
       !
@@ -332,30 +367,27 @@
       !                                            ! ---------------------------------------- !
       !
-      IF( nn_components /= jp_iam_sas )   CALL sbc_ssm ( kt )  ! ocean sea surface variables (sst_m, sss_m, ssu_m, ssv_m)
-      !                                                        ! averaged over nf_sbc time-step
-      IF( ln_wave                     )   CALL sbc_wave( kt )  ! surface waves
-      
-      
-                                                   !==  sbc formulation  ==!
-                                                            
+      ll_sas = nn_components == jp_iam_sas               ! component flags
+      ll_opa = nn_components == jp_iam_opa
+      !
+      IF( .NOT.ll_sas )   CALL sbc_ssm ( kt )            ! mean ocean sea surface variables (sst_m, sss_m, ssu_m, ssv_m)
+      IF( ln_wave     )   CALL sbc_wave( kt )            ! surface waves
+
+      !
+      !                                            !==  sbc formulation  ==!
+      !                                                   
       SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition
       !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx)
-      CASE( jp_usr   )   ;   CALL usr_def_sbc ( kt )                    ! user defined formulation 
-      CASE( jp_flx   )   ;   CALL sbc_flx     ( kt )                    ! flux formulation
-      CASE( jp_clio  )   ;   CALL sbc_blk_clio( kt )                    ! bulk formulation : CLIO for the ocean
-      CASE( jp_core  )   
-         IF( nn_components == jp_iam_sas ) &
-            &                CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: SAS receiving fields from OPA 
-                             CALL sbc_blk_core( kt )                    ! bulk formulation : CORE for the ocean
-                                                                        ! from oce: sea surface variables (sst_m, sss_m,  ssu_m,  ssv_m)
-      CASE( jp_purecpl )  ;  CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! pure coupled formulation
-                                                                        !
-      CASE( jp_mfs   )   ;   CALL sbc_blk_mfs ( kt )                    ! bulk formulation : MFS for the ocean
-      CASE( jp_none  ) 
-         IF( nn_components == jp_iam_opa )   &
-            &                CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: OPA receiving fields from SAS
+      CASE( jp_usr   )     ;   CALL usr_def_sbc( kt )                    ! user defined formulation 
+      CASE( jp_flx     )   ;   CALL sbc_flx    ( kt )                    ! flux formulation
+      CASE( jp_blk     )
+         IF( ll_sas    )       CALL sbc_cpl_rcv( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: SAS receiving fields from OPA
+                               CALL sbc_blk    ( kt )                    ! bulk formulation for the ocean
+                               !
+      CASE( jp_purecpl )   ;   CALL sbc_cpl_rcv( kt, nn_fsbc, nn_ice )   ! pure coupled formulation
+      CASE( jp_none    )
+         IF( ll_opa    )       CALL sbc_cpl_rcv( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: OPA receiving fields from SAS
       END SELECT
 
-      IF( ln_mixcpl )        CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing
+      IF( ln_mixcpl )          CALL sbc_cpl_rcv( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing
 
       !
@@ -367,5 +399,5 @@
       CASE(  3 )   ;         CALL sbc_ice_lim  ( kt, nsbc )          ! LIM-3 ice model
       CASE(  4 )   ;         CALL sbc_ice_cice ( kt, nsbc )          ! CICE ice model
-      END SELECT                                              
+      END SELECT
 
       IF( ln_icebergs    )   CALL icb_stp( kt )                   ! compute icebergs
@@ -374,11 +406,10 @@
 
       IF( ln_rnf         )   CALL sbc_rnf( kt )                   ! add runoffs to fresh water fluxes
- 
+
       IF( ln_ssr         )   CALL sbc_ssr( kt )                   ! add SST/SSS damping term
 
       IF( nn_fwb    /= 0 )   CALL sbc_fwb( kt, nn_fwb, nn_fsbc )  ! control the freshwater budget
 
-      ! treatment of closed sea in the model domain 
-      ! (update freshwater fluxes)
+      ! treatment of closed sea in the model domain   (update freshwater fluxes)
       ! Should not be ran if ln_diurnal_only
       IF( .NOT.ln_diurnal_only .AND. nn_closea == 1 )   CALL sbc_clo( kt, cn_cfg, nn_cfg )   
@@ -391,5 +422,5 @@
          !                                             ! ---------------------------------------- !
          IF( ln_rstart .AND.    &                               !* Restart: read in restart file
-            & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN 
+            & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN
             IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file'
             CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b )   ! before i-stress  (U-point)
@@ -407,9 +438,9 @@
          ELSE                                                   !* no restart: set from nit000 values
             IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields set to nit000'
-            utau_b(:,:) = utau(:,:) 
+            utau_b(:,:) = utau(:,:)
             vtau_b(:,:) = vtau(:,:)
             qns_b (:,:) = qns (:,:)
-            emp_b (:,:) = emp(:,:)
-            sfx_b (:,:) = sfx(:,:)
+            emp_b (:,:) = emp (:,:)
+            sfx_b (:,:) = sfx (:,:)
          ENDIF
       ENDIF
@@ -435,18 +466,16 @@
          CALL iom_put( "empmr"  , emp    - rnf )                ! upward water flux
          CALL iom_put( "empbmr" , emp_b  - rnf )                ! before upward water flux ( needed to recalculate the time evolution of ssh in offline )
-         CALL iom_put( "saltflx", sfx  )                        ! downward salt flux  
-                                                                ! (includes virtual salt flux beneath ice 
-                                                                ! in linear free surface case)
+         CALL iom_put( "saltflx", sfx  )                        ! downward salt flux (includes virtual salt flux beneath ice in linear free surface case)
          CALL iom_put( "fmmflx", fmmflx  )                      ! Freezing-melting water flux
-         CALL iom_put( "qt"    , qns  + qsr )                   ! total heat flux 
+         CALL iom_put( "qt"    , qns  + qsr )                   ! total heat flux
          CALL iom_put( "qns"   , qns        )                   ! solar heat flux
          CALL iom_put( "qsr"   ,       qsr  )                   ! solar heat flux
-         IF( nn_ice > 0 .OR. nn_components == jp_iam_opa )   CALL iom_put( "ice_cover", fr_i )   ! ice fraction 
-         CALL iom_put( "taum"  , taum       )                   ! wind stress module 
+         IF( nn_ice > 0 .OR. ll_opa )   CALL iom_put( "ice_cover", fr_i )   ! ice fraction
+         CALL iom_put( "taum"  , taum       )                   ! wind stress module
          CALL iom_put( "wspd"  , wndm       )                   ! wind speed  module over free ocean or leads in presence of sea-ice
       ENDIF
       !
-      CALL iom_put( "utau", utau )   ! i-wind stress   (stress can be updated at 
-      CALL iom_put( "vtau", vtau )   ! j-wind stress    each time step in sea-ice)
+      CALL iom_put( "utau", utau )   ! i-wind stress   (stress can be updated at each time step in sea-ice)
+      CALL iom_put( "vtau", vtau )   ! j-wind stress
       !
       IF(ln_ctl) THEN         ! print mean trends (used for debugging)
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 7280)
@@ -279,6 +279,6 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'sbc_rnf : runoff '
-         WRITE(numout,*) '~~~~~~~ '
+         WRITE(numout,*) 'sbc_rnf_init : runoff '
+         WRITE(numout,*) '~~~~~~~~~~~~ '
          WRITE(numout,*) '   Namelist namsbc_rnf'
          WRITE(numout,*) '      specific river mouths treatment            ln_rnf_mouth = ', ln_rnf_mouth
@@ -296,9 +296,9 @@
          IF(lwp) WRITE(numout,*) '          runoffs inflow read in a file'
          IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
+            CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_rnf structure' )   ;   RETURN
          ENDIF
          ALLOCATE( sf_rnf(1)%fnow(jpi,jpj,1)   )
          IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) )
-         CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' )
+         CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf', no_print )
       ENDIF
       !
@@ -312,5 +312,5 @@
          ALLOCATE( sf_t_rnf(1)%fnow(jpi,jpj,1)   )
          IF( sn_t_rnf%ln_tint ) ALLOCATE( sf_t_rnf(1)%fdta(jpi,jpj,1,2) )
-         CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' )
+         CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf', no_print )
       ENDIF
       !
@@ -324,5 +324,5 @@
          ALLOCATE( sf_s_rnf(1)%fnow(jpi,jpj,1)   )
          IF( sn_s_rnf%ln_tint ) ALLOCATE( sf_s_rnf(1)%fdta(jpi,jpj,1,2) )
-         CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' )
+         CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf', no_print )
       ENDIF
       !
@@ -452,5 +452,5 @@
             DO WHILE( nkrnf /= jpkm1 .AND. gdepw_1d(nkrnf+1) < rn_hrnf )   ;   nkrnf = nkrnf + 1
             END DO
-            IF( ln_sco )   CALL ctl_warn( 'sbc_rnf: number of levels over which Kz is increased is computed for zco...' )
+            IF( ln_sco )   CALL ctl_warn( 'sbc_rnf_init: number of levels over which Kz is increased is computed for zco...' )
          ENDIF
          IF(lwp) WRITE(numout,*)
@@ -499,6 +499,6 @@
       !
       IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~ '
+      IF(lwp) WRITE(numout,*) '   rnf_mouth : river mouth mask'
+      IF(lwp) WRITE(numout,*) '   ~~~~~~~~~ '
       !
       cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname )
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 7280)
@@ -88,5 +88,6 @@
             !                                             ! ----------------------------------------------- !
             IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '~~~~~~~   mean fields initialised to instantaneous values'
+            IF(lwp) WRITE(numout,*) 'sbc_ssm : mean fields initialised to instantaneous values'
+            IF(lwp) WRITE(numout,*) '~~~~~~~   '
             zcoef = REAL( nn_fsbc - 1, wp )
             ssu_m(:,:) = zcoef * ub(:,:,1)
@@ -194,12 +195,12 @@
          !
          IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields, nn_fsbc=1 : instantaneous values'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         IF(lwp) WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields, nn_fsbc=1 : instantaneous values'
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
          !
       ELSE
          !               
          IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         IF(lwp) WRITE(numout,*) 'sbc_ssm_init : sea surface mean fields'
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
          !
          IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN
@@ -220,6 +221,5 @@
             !
             IF( zf_sbc /= REAL( nn_fsbc, wp ) ) THEN      ! nn_fsbc has changed between 2 runs
-               IF(lwp) WRITE(numout,*) '~~~~~~~   restart with a change in the frequency of mean ',   &
-                  &                    'from ', zf_sbc, ' to ', nn_fsbc 
+               IF(lwp) WRITE(numout,*) '   restart with a change in the frequency of mean from ', zf_sbc, ' to ', nn_fsbc 
                zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc 
                ssu_m(:,:) = zcoef * ssu_m(:,:) 
@@ -231,5 +231,5 @@
                frq_m(:,:) = zcoef * frq_m(:,:)
             ELSE
-               IF(lwp) WRITE(numout,*) '~~~~~~~   mean fields read in the ocean restart file'
+               IF(lwp) WRITE(numout,*) '   mean fields read in the ocean restart file'
             ENDIF
          ENDIF
@@ -238,9 +238,9 @@
       IF( .NOT. l_ssm_mean ) THEN   ! default initialisation. needed by lim_istate
          !
-         IF(lwp) WRITE(numout,*) '          default initialisation of ss?_m arrays'
+         IF(lwp) WRITE(numout,*) '   default initialisation of ss._m arrays'
          ssu_m(:,:) = ub(:,:,1)
          ssv_m(:,:) = vb(:,:,1)
          IF( l_useCT )  THEN    ;   sst_m(:,:) = eos_pt_from_ct( tsn(:,:,1,jp_tem), tsn(:,:,1,jp_sal) )
-         ELSE                    ;   sst_m(:,:) = tsn(:,:,1,jp_tem)
+         ELSE                   ;   sst_m(:,:) = tsn(:,:,1,jp_tem)
          ENDIF
          sss_m(:,:) = tsn  (:,:,1,jp_sal)
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 7280)
@@ -199,5 +199,5 @@
          !
          ! fill sf_sst with sn_sst and control print
-         CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr' )
+         CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr', no_print )
          IF( sf_sst(1)%ln_tint )   ALLOCATE( sf_sst(1)%fdta(jpi,jpj,1,2), STAT=ierror )
          IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst data array' )
@@ -213,5 +213,5 @@
          !
          ! fill sf_sss with sn_sss and control print
-         CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr' )
+         CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr', no_print )
          IF( sf_sss(1)%ln_tint )   ALLOCATE( sf_sss(1)%fdta(jpi,jpj,1,2), STAT=ierror )
          IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss data array' )
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 7280)
@@ -25,5 +25,5 @@
    PRIVATE
 
-   PUBLIC   sbc_wave    ! routine called in sbc_blk_core or sbc_blk_mfs
+   PUBLIC   sbc_wave    ! routine called in sbc_blk
    
    INTEGER , PARAMETER ::   jpfld  = 3   ! maximum number of files to read for srokes drift
@@ -94,6 +94,6 @@
          IF( .NOT.( ln_cdgw .OR. ln_sdw ) )    &
             &  CALL ctl_warn( 'ln_sbcwave=T but nor drag coefficient (ln_cdgw=F) neither stokes drift activated (ln_sdw=F)' )
-         IF( ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) )   &       
-            &  CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core')
+         IF( ln_cdgw .AND. .NOT.ln_blk )   &       
+            &  CALL ctl_stop( 'drag coefficient read from wave model definable only with bulk formulae')
          !
          IF( ln_cdgw ) THEN
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7280)
@@ -255,13 +255,13 @@
          WRITE(numout,*)
          SELECT CASE ( nadv )
-         CASE( np_NO_adv  )   ;   WRITE(numout,*) '         NO T-S advection'
-         CASE( np_CEN     )   ;   WRITE(numout,*) '         CEN      scheme is used. Horizontal order: ', nn_cen_h,   &
+         CASE( np_NO_adv  )   ;   WRITE(numout,*) '      ===>>   NO T-S advection'
+         CASE( np_CEN     )   ;   WRITE(numout,*) '      ===>>   CEN      scheme is used. Horizontal order: ', nn_cen_h,   &
             &                                                                     ' Vertical   order: ', nn_cen_v
-         CASE( np_FCT     )   ;   WRITE(numout,*) '         FCT      scheme is used. Horizontal order: ', nn_fct_h,   &
+         CASE( np_FCT     )   ;   WRITE(numout,*) '      ===>>   FCT      scheme is used. Horizontal order: ', nn_fct_h,   &
             &                                                                      ' Vertical   order: ', nn_fct_v
-         CASE( np_FCT_zts )   ;   WRITE(numout,*) '         use 2nd order FCT with ', nn_fct_zts,'vertical sub-timestepping'
-         CASE( np_MUS     )   ;   WRITE(numout,*) '         MUSCL    scheme is used'
-         CASE( np_UBS     )   ;   WRITE(numout,*) '         UBS      scheme is used'
-         CASE( np_QCK     )   ;   WRITE(numout,*) '         QUICKEST scheme is used'
+         CASE( np_FCT_zts )   ;   WRITE(numout,*) '      ===>>   use 2nd order FCT with ', nn_fct_zts,'vertical sub-timestepping'
+         CASE( np_MUS     )   ;   WRITE(numout,*) '      ===>>   MUSCL    scheme is used'
+         CASE( np_UBS     )   ;   WRITE(numout,*) '      ===>>   UBS      scheme is used'
+         CASE( np_QCK     )   ;   WRITE(numout,*) '      ===>>   QUICKEST scheme is used'
          END SELECT
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mle.F90	(revision 7280)
@@ -308,9 +308,9 @@
          WRITE(numout,*)
          IF( ln_mle ) THEN
-            WRITE(numout,*) '   Mixed Layer Eddy induced transport added to tracer advection'
-            IF( nn_mle == 0 )   WRITE(numout,*) '   Fox-Kemper et al 2010 formulation'
-            IF( nn_mle == 1 )   WRITE(numout,*) '   New formulation'
+            WRITE(numout,*) '      ===>>   Mixed Layer Eddy induced transport added to tracer advection'
+            IF( nn_mle == 0 )   WRITE(numout,*) '              Fox-Kemper et al 2010 formulation'
+            IF( nn_mle == 1 )   WRITE(numout,*) '              New formulation'
          ELSE
-            WRITE(numout,*) '   Mixed Layer Eddy parametrisation NOT used'
+            WRITE(numout,*) '      ===>>   Mixed Layer Eddy parametrisation NOT used'
          ENDIF
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 7280)
@@ -176,5 +176,5 @@
             ! fill sf_chl with sn_chl and control print
             CALL fld_fill( sf_qgh, (/ sn_qgh /), cn_dir, 'tra_bbc_init',   &
-               &          'bottom temperature boundary condition', 'nambbc' )
+               &          'bottom temperature boundary condition', 'nambbc', no_print )
 
             CALL fld_read( nit000, 1, sf_qgh )                         ! Read qgh data
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7280)
@@ -519,9 +519,9 @@
          WRITE(numout,*) 'tra_bbl_init : bottom boundary layer initialisation'
          WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) '       Namelist nambbl : set bbl parameters'
-         WRITE(numout,*) '          diffusive bbl (=1)   or not (=0)    nn_bbl_ldf = ', nn_bbl_ldf
-         WRITE(numout,*) '          advective bbl (=1/2) or not (=0)    nn_bbl_adv = ', nn_bbl_adv
-         WRITE(numout,*) '          diffusive bbl coefficient           rn_ahtbbl  = ', rn_ahtbbl, ' m2/s'
-         WRITE(numout,*) '          advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
+         WRITE(numout,*) '   Namelist nambbl : set bbl parameters'
+         WRITE(numout,*) '      diffusive bbl (=1)   or not (=0)    nn_bbl_ldf = ', nn_bbl_ldf
+         WRITE(numout,*) '      advective bbl (=1/2) or not (=0)    nn_bbl_adv = ', nn_bbl_adv
+         WRITE(numout,*) '      diffusive bbl coefficient           rn_ahtbbl  = ', rn_ahtbbl, ' m2/s'
+         WRITE(numout,*) '      advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
       ENDIF
 
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 7280)
@@ -192,5 +192,5 @@
          WRITE(numout,*)
          WRITE(numout,*) 'tra_dmp_init : T and S newtonian relaxation'
-         WRITE(numout,*) '~~~~~~~~~~~'
+         WRITE(numout,*) '~~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namtra_dmp : set relaxation parameters'
          WRITE(numout,*) '      Apply relaxation   or not       ln_tradmp = ', ln_tradmp
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 7280)
@@ -110,8 +110,7 @@
          WRITE(numout,*)
          WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator'
-         WRITE(numout,*) '~~~~~~~~~~~'
+         WRITE(numout,*) '~~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namtra_ldf: already read in ldftra module'
          WRITE(numout,*) '      see ldf_tra_init report for lateral mixing parameters'
-         WRITE(numout,*)
       ENDIF
       !                                   ! use of lateral operator or not
@@ -187,11 +186,11 @@
          WRITE(numout,*)
          SELECT CASE( nldf )
-         CASE( np_no_ldf )   ;   WRITE(numout,*) '   NO lateral diffusion'
-         CASE( np_lap    )   ;   WRITE(numout,*) '   laplacian iso-level operator'
-         CASE( np_lap_i  )   ;   WRITE(numout,*) '   Rotated laplacian operator (standard)'
-         CASE( np_lap_it )   ;   WRITE(numout,*) '   Rotated laplacian operator (triad)'
-         CASE( np_blp    )   ;   WRITE(numout,*) '   bilaplacian iso-level operator'
-         CASE( np_blp_i  )   ;   WRITE(numout,*) '   Rotated bilaplacian operator (standard)'
-         CASE( np_blp_it )   ;   WRITE(numout,*) '   Rotated bilaplacian operator (triad)'
+         CASE( np_no_ldf )   ;   WRITE(numout,*) '      ===>>   NO lateral diffusion'
+         CASE( np_lap    )   ;   WRITE(numout,*) '      ===>>   laplacian iso-level operator'
+         CASE( np_lap_i  )   ;   WRITE(numout,*) '      ===>>   Rotated laplacian operator (standard)'
+         CASE( np_lap_it )   ;   WRITE(numout,*) '      ===>>   Rotated laplacian operator (triad)'
+         CASE( np_blp    )   ;   WRITE(numout,*) '      ===>>   bilaplacian iso-level operator'
+         CASE( np_blp_i  )   ;   WRITE(numout,*) '      ===>>   Rotated bilaplacian operator (standard)'
+         CASE( np_blp_it )   ;   WRITE(numout,*) '      ===>>   Rotated bilaplacian operator (triad)'
          END SELECT
       ENDIF
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 7280)
@@ -406,5 +406,5 @@
             !                                        ! fill sf_chl with sn_chl and control print
             CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init',   &
-               &           'Solar penetration function of read chlorophyll', 'namtra_qsr' )
+               &           'Solar penetration function of read chlorophyll', 'namtra_qsr' , no_print )
          ENDIF
          IF( nqsr == np_RGB ) THEN                 ! constant Chl
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 7280)
@@ -141,6 +141,6 @@
          WRITE(numout,*) 'tra_zdf_init : vertical tracer physics scheme'
          WRITE(numout,*) '~~~~~~~~~~~'
-         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme'
-         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme'
+         IF( nzdf ==  0 )   WRITE(numout,*) '      ===>>   Explicit time-splitting scheme'
+         IF( nzdf ==  1 )   WRITE(numout,*) '      ===>>   Implicit (euler backward) scheme'
       ENDIF
       !
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90	(revision 7280)
@@ -57,6 +57,6 @@
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
-         WRITE(numout,*) ' trd_init : Momentum/Tracers trends'
-         WRITE(numout,*) ' ~~~~~~~~~~'
+         WRITE(numout,*) 'trd_init : Momentum/Tracers trends'
+         WRITE(numout,*) '~~~~~~~~'
          WRITE(numout,*) '   Namelist namtrd : set trends parameters'
          WRITE(numout,*) '      global domain averaged dyn & tra trends   ln_glo_trd  = ', ln_glo_trd
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 7280)
@@ -99,10 +99,4 @@
       !
       IF( nn_timing == 1 )  CALL timing_start('zdf_bfr')
-      !
-      IF( kt == nit000 .AND. lwp ) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'zdf_bfr : Set bottom friction coefficient (non-linear case)'
-         WRITE(numout,*) '~~~~~~~~'
-      ENDIF
       !
       IF( nn_bfr == 2 ) THEN                 ! quadratic bottom friction only
@@ -259,5 +253,5 @@
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'zdf_bfr_init : momentum bottom friction'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
       IF(lwp) WRITE(numout,*) '   Namelist nam_bfr : set bottom friction parameters'
       !
@@ -266,8 +260,8 @@
       CASE( 0 )
          IF(lwp) WRITE(numout,*) '      free-slip '
-         bfrua(:,:) = 0.e0
-         bfrva(:,:) = 0.e0
-         tfrua(:,:) = 0.e0
-         tfrva(:,:) = 0.e0
+         bfrua(:,:) = 0._wp
+         bfrva(:,:) = 0._wp
+         tfrua(:,:) = 0._wp
+         tfrva(:,:) = 0._wp
          !
       CASE( 1 )
@@ -321,5 +315,5 @@
          IF(lwp) WRITE(numout,*) '      log formulation   ln_bfr2d = ', ln_loglayer
          IF(lwp) WRITE(numout,*) '      bottom roughness  rn_bfrz0 [m] = ', rn_bfrz0
-         IF( rn_bfrz0<=0.e0 ) THEN
+         IF( rn_bfrz0 <= 0._wp ) THEN
             WRITE(ctmp1,*) '      bottom roughness must be strictly positive'
             CALL ctl_stop( ctmp1 )
@@ -336,5 +330,5 @@
             IF(lwp) WRITE(numout,*) '      log formulation   ln_tfr2d     = ', ln_loglayer
             IF(lwp) WRITE(numout,*) '      top roughness     rn_tfrz0 [m] = ', rn_tfrz0
-            IF( rn_tfrz0<=0.e0 ) THEN
+            IF( rn_tfrz0 <= 0._wp ) THEN
                WRITE(ctmp1,*) '      top roughness must be strictly positive'
                CALL ctl_stop( ctmp1 )
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 7280)
@@ -66,5 +66,5 @@
       IF(lwp) THEN               !* Parameter print
          WRITE(numout,*)
-         WRITE(numout,*) 'zdf_init: vertical physics'
+         WRITE(numout,*) 'zdf_init : vertical physics'
          WRITE(numout,*) '~~~~~~~~'
          WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters'
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7280)
@@ -560,6 +560,6 @@
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
-         WRITE(numout,*) 'namcfg  : configuration initialization through namelist read'
-         WRITE(numout,*) '~~~~~~~ '
+         WRITE(numout,*) 'namcfg : configuration initialization through namelist read'
+         WRITE(numout,*) '~~~~~~ '
          WRITE(numout,*) '   Namelist namcfg'
          WRITE(numout,*) '      read domain configuration file                ln_read_cfg      = ', ln_read_cfg
Index: /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90
===================================================================
--- /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90	(revision 7279)
+++ /branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90	(revision 7280)
@@ -110,6 +110,6 @@
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'trc_oce_rgb : Initialisation of the optical look-up table'
-         WRITE(numout,*) '~~~~~~~~~~~ '
+         WRITE(numout,*) '   trc_oce_rgb : Initialisation of the optical look-up table'
+         WRITE(numout,*) '   ~~~~~~~~~~~ '
       ENDIF
       !
