Index: branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 10798)
+++ branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 10879)
@@ -98,17 +98,20 @@
    LOGICAL , PUBLIC ::   lhftau = .FALSE.        !: HF tau used in TKE: mean(stress module) - module(mean stress)
    !!                                   !!   now    ! before   !!
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2] 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)       [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)       [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)      [N/m2] 
    !! wndm is used onmpute surface gases exchanges in ice-free ocean or leads
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                     [W/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tot           !: total     solar heat flux (over sea and ice) [W/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns_tot           !: total non solar heat flux (over sea and ice) [W/m2]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp    , emp_b    !: freshwater budget: volume flux               [Kg/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx    , sfx_b    !: salt flux                                    [PSU/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)    [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                       [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                       [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qlw               !: downward longwave heat flux over sea non solar [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsb               !: downward sensible heat flux over sea non solar [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qla               !: downward latent heat flux over sea non solar   [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tot           !: total     solar heat flux (over sea and ice)   [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns_tot           !: total non solar heat flux (over sea and ice)   [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp    , emp_b    !: freshwater budget: volume flux                 [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx    , sfx_b    !: salt flux                                      [PSU/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                   [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting            [Kg/m2/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff        [Kg/m2/s]  
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwfisf , fwfisf_b !: ice shelf melting   [Kg/m2/s]  
@@ -188,4 +191,5 @@
          !
       ALLOCATE( qns_tot(jpi,jpj) , qns  (jpi,jpj) , qns_b(jpi,jpj),        &
+         &      qlw    (jpi,jpj) , qsb  (jpi,jpj) , qla  (jpi,jpj),        &
          &      qsr_tot(jpi,jpj) , qsr  (jpi,jpj) ,                        &
          &      emp    (jpi,jpj) , emp_b(jpi,jpj) ,                        &
Index: branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 10798)
+++ branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 10879)
@@ -253,6 +253,5 @@
       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 ::   zevap             ! evaporation
       REAL(wp), DIMENSION(:,:), POINTER ::   Cd                ! transfer coefficient for momentum      (tau)
       REAL(wp), DIMENSION(:,:), POINTER ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
@@ -265,5 +264,5 @@
       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, zwnd_i, zwnd_j, zqsatw, zevap )
       CALL wrk_alloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu )
       !
@@ -311,5 +310,5 @@
       ENDIF
 
-      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
+      qlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
       ! ----------------------------------------------------------------------------- !
       !     II    Turbulent FLUXES                                                    !
@@ -359,17 +358,17 @@
          !! 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
+         qsb (:,:) =                     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
+         qsb (:,:) =                     cpa*rhoa*Ch(:,:)*( zst   (:,:) - zt_zu(:,:) )*wndm(:,:)     ! Sensible Heat
+      ENDIF
+      qla (:,:) = 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=qla  , clinfo1=' blk_oce_core: qla   : ', tab2d_2=Ce , clinfo2=' Ce  : ' )
+         CALL prt_ctl( tab2d_1=qsb  , clinfo1=' blk_oce_core: qsb   : ', tab2d_2=Ch , clinfo2=' Ch  : ' )
+         CALL prt_ctl( tab2d_1=qlw  , clinfo1=' blk_oce_core: qlw   : ', 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,   &
@@ -386,5 +385,5 @@
          &         - sf(jp_prec)%fnow(:,:,1) * rn_pfac  ) * tmask(:,:,1)
       !
-      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                &   ! Downward Non Solar 
+      qns(:,:) = qlw(:,:) - qsb(:,:) - qla(:,:)                                   &   ! 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
@@ -395,25 +394,25 @@
       !
 #if defined key_lim3
-      qns_oce(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                                ! non solar without emp (only needed by LIM3)
+      qns_oce(:,:) = qlw(:,:) - qsb(:,:) - qla(:,:)                                ! 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
+          CALL iom_put( "qlw_oce" ,   qlw )                  ! output downward longwave heat over the ocean
+          CALL iom_put( "qsb_oce" , - qsb )                  ! output downward sensible heat over the ocean
+          CALL iom_put( "qla_oce" , - qla )                  ! output downward latent   heat over the ocean
+          CALL iom_put( "qemp_oce",   qns-qlw+qsb+qla )      ! 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=qsb , clinfo1=' blk_oce_core: qsb   : ', tab2d_2=qlw , clinfo2=' qlw  : ')
+         CALL prt_ctl(tab2d_1=qla , clinfo1=' blk_oce_core: qla   : ', 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,   &
@@ -421,5 +420,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zqlw, zqsb, zqla, zevap )
+      CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j, zqsatw, zevap )
       CALL wrk_dealloc( jpi,jpj, Cd, Ch, Ce, zst, zt_zu, zq_zu )
       !
Index: branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10798)
+++ branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10879)
@@ -668,9 +668,12 @@
 ! Solar penetrative radiation and non solar surface heat flux
 
-! Scale qsr and qns according to ice fraction (bulk formulae only)
+! Scale qsr, qns, qlw, qsb, qla according to ice fraction (bulk formulae only)
 
       IF (ksbc == jp_core) THEN
          qsr(:,:)=qsr(:,:)*(1.0-fr_i(:,:))
          qns(:,:)=qns(:,:)*(1.0-fr_i(:,:))
+         qlw(:,:)=qlw(:,:)*(1.0-fr_i(:,:))
+         qsb(:,:)=qsb(:,:)*(1.0-fr_i(:,:))
+         qla(:,:)=qla(:,:)*(1.0-fr_i(:,:))
       ENDIF
 ! Take into account snow melting except for fully coupled when already in qns_tot
@@ -680,4 +683,5 @@
       ELSE
          qns(:,:)= qns(:,:)-sprecip(:,:)*Lfresh*(1.0-fr_i(:,:))
+         qla(:,:)= qla(:,:)+sprecip(:,:)*Lfresh*(1.0-fr_i(:,:))
       ENDIF
 
Index: branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 10798)
+++ branches/UKMO/dev_r5518_FOAMv14_output_heat_fluxes/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 10879)
@@ -479,4 +479,9 @@
          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
+         IF( nn_ice > 0 ) THEN 
+            CALL iom_put( "qlw_oce"  ,   qlw   )                ! output surface_net_downward_longwave_flux
+            CALL iom_put( "qsb_oce"  , - qsb   )                ! output surface_downward_sensible_heat_flux
+            CALL iom_put( "qla_oce"  , - qla   )                ! output surface_downward_latent_heat_flux
+         ENDIF
       ENDIF
       !
