Index: trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90	(revision 2484)
+++ trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90	(revision 2485)
@@ -29,7 +29,8 @@
       real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
       real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
+      real, dimension(:),allocatable,save :: albedo_equivalent1     ! Spectral Mean albedo clear sky.
       real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
       real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
-!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
+!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_equivalent1,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
 
       real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
@@ -49,13 +50,17 @@
 
       real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
+      real,dimension(:),allocatable,save :: fluxsurf_lw1     ! Incident Long Wave (IR) surface flux (W.m-2) clear sky.
       real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
+      real,dimension(:),allocatable,save :: fluxsurf_sw1     ! Incident Short Wave (stellar) surface flux (W.m-2) clear sky.
       real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
-!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw)
+!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_lw1,fluxsurf_sw,fluxsurf_sw1,fluxsurfabs_sw)
 
       real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
+      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
       real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
+      real,dimension(:),allocatable,save :: fluxabs_sw1      ! Absorbed SW (stellar) flux (W.m-2) clear sky.
       real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
       real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
-!$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn)
+!$OMP THREADPRIVATE(fluxtop_lw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
 
       real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
@@ -86,12 +91,29 @@
 !$OMP THREADPRIVATE(ice_initial,ice_min)
 
-      real, dimension(:),allocatable,save ::  pctsrf_sic
-      real, dimension(:,:),allocatable,save :: tslab
-      real, dimension(:),allocatable,save ::  tsea_ice
-      real, dimension(:),allocatable,save :: sea_ice
-      real, dimension(:),allocatable,save :: zmasq
-      integer, dimension(:),allocatable,save ::knindex
+      real,dimension(:),allocatable,save ::  pctsrf_sic
+      real,dimension(:,:),allocatable,save :: tslab        ! Slab_ocean temperature (K)
+      real,dimension(:),allocatable,save ::  tsea_ice      ! Sea ice temperature (K)
+      real,dimension(:),allocatable,save :: sea_ice
+      real,dimension(:),allocatable,save :: zmasq
+      integer,dimension(:),allocatable,save ::knindex
       real,allocatable,dimension(:,:,:),save :: reffrad
-!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad)
+      real,dimension(:), allocatable,save :: fluxgrdocean  ! Surface conduction flux (W.m-2) with slab_ocean.
+!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad,fluxgrdocean)
+
+      real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
+      real,dimension(:),allocatable,save :: dEdiff      ! Integrated turbulent diffusion heating (W.m-2)
+      real,dimension(:),allocatable,save :: dEdiffs
+      real,dimension(:,:),allocatable,save :: dEzRadsw  ! Radiative heating (W.m-2)
+      real,dimension(:,:),allocatable,save :: dEzRadlw  ! Radiative heating (W.m-2)
+!$OMP THREADPRIVATE(dEzdiff,dEzdiffs,dEzRadsw,dEzRadlw)
+
+      real,dimension(:),allocatable,save :: madjdE      ! Heat from moistadj (W.m-2)
+      real,dimension(:,:),allocatable,save :: madjdEz   ! Heat from moistadj (W.m-2)
+      real,dimension(:),allocatable,save :: lscaledE    ! Heat from largescale (W.m-2)
+      real,dimension(:,:),allocatable,save :: lscaledEz ! Heat from largescale (W.m-2)
+!$OMP THREADPRIVATE(madjdE,madjdEz,lscaledE,lscaledEz)
+      
+      real,dimension(:),allocatable,save :: H2Omaxcol ! Maximum possible H2O column amount (at 100% saturation) (kg.m-2).
+!$OMP THREADPRIVATE(H2Omaxcol)
       
 CONTAINS
@@ -114,5 +136,5 @@
 !zval(:)   ! Minimum de l'OESM
 !rugoro(:) ! longueur de rugosite de l'OESM 
-        print*,'klon',klon,'klev',klev
+
         ALLOCATE(phisfi(klon))
         ALLOCATE(tsurf(klon))
@@ -120,4 +142,5 @@
         ALLOCATE(albedo(klon,L_NSPECTV))
         ALLOCATE(albedo_equivalent(klon))
+        ALLOCATE(albedo_equivalent1(klon))
         ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
         ALLOCATE(albedo_co2_ice_SPECTV(L_NSPECTV))
@@ -130,4 +153,5 @@
         ALLOCATE(capcal(klon))
         ALLOCATE(fluxgrd(klon))
+        ALLOCATE(fluxgrdocean(klon))
         ALLOCATE(qsurf(klon,nqtot))
         ALLOCATE(q2(klon,klev+1))
@@ -143,8 +167,12 @@
         ALLOCATE(ice_min(klon))
         ALLOCATE(fluxsurf_lw(klon))
+        ALLOCATE(fluxsurf_lw1(klon))
         ALLOCATE(fluxsurf_sw(klon))
+        ALLOCATE(fluxsurf_sw1(klon))
         ALLOCATE(fluxsurfabs_sw(klon))
         ALLOCATE(fluxtop_lw(klon))
+        ALLOCATE(fluxtop_lw1(klon))
         ALLOCATE(fluxabs_sw(klon))
+        ALLOCATE(fluxabs_sw1(klon))
         ALLOCATE(fluxtop_dn(klon))
         ALLOCATE(fluxdyn(klon))
@@ -163,4 +191,14 @@
         ALLOCATE(zmasq(klon))
         ALLOCATE(knindex(klon))
+        ALLOCATE(dEzdiff(klon,klev))
+        ALLOCATE(dEdiff(klon))
+        ALLOCATE(dEdiffs(klon))
+        ALLOCATE(dEzRadsw(klon,klev))
+        ALLOCATE(dEzRadlw(klon,klev))
+        ALLOCATE(madjdE(klon))
+        ALLOCATE(madjdEz(klon,klev))
+        ALLOCATE(lscaledE(klon))
+        ALLOCATE(lscaledEz(klon,klev))
+        ALLOCATE(H2Omaxcol(klon))
         ! This is defined in comsaison_h
         ALLOCATE(mu0(klon))
@@ -193,4 +231,5 @@
         DEALLOCATE(albedo)
         DEALLOCATE(albedo_equivalent)
+        DEALLOCATE(albedo_equivalent1)
         DEALLOCATE(albedo_snow_SPECTV)
         DEALLOCATE(albedo_co2_ice_SPECTV)
@@ -204,4 +243,5 @@
 
         DEALLOCATE(fluxgrd)
+        DEALLOCATE(fluxgrdocean)
         DEALLOCATE(qsurf)
         DEALLOCATE(q2)
@@ -217,8 +257,12 @@
         DEALLOCATE(ice_min)
         DEALLOCATE(fluxsurf_lw)
+        DEALLOCATE(fluxsurf_lw1)
         DEALLOCATE(fluxsurf_sw)
+        DEALLOCATE(fluxsurf_sw1)
         DEALLOCATE(fluxsurfabs_sw)
         DEALLOCATE(fluxtop_lw)
+        DEALLOCATE(fluxtop_lw1)
         DEALLOCATE(fluxabs_sw)
+        DEALLOCATE(fluxabs_sw1)
         DEALLOCATE(fluxtop_dn)
         DEALLOCATE(fluxdyn)
@@ -237,4 +281,14 @@
         DEALLOCATE(zmasq)
         DEALLOCATE(knindex)
+        DEALLOCATE(dEzdiff)
+        DEALLOCATE(dEdiff)
+        DEALLOCATE(dEdiffs)
+        DEALLOCATE(dEzRadsw)
+        DEALLOCATE(dEzRadlw)
+        DEALLOCATE(madjdE)
+        DEALLOCATE(madjdEz)
+        DEALLOCATE(lscaledE)
+        DEALLOCATE(lscaledEz)
+        DEALLOCATE(H2Omaxcol)        
         DEALLOCATE(mu0)
         DEALLOCATE(fract)
Index: trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2484)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2485)
@@ -383,7 +383,4 @@
       real,save :: dEtotSW, dEtotsSW, dEtotLW, dEtotsLW
 !$OMP THREADPRIVATE(dEtotSW, dEtotsSW, dEtotLW, dEtotsLW)
-      real dEzRadsw(ngrid,nlayer),dEzRadlw(ngrid,nlayer),dEzdiff(ngrid,nlayer)
-      real dEdiffs(ngrid),dEdiff(ngrid)
-      real madjdE(ngrid), lscaledE(ngrid),madjdEz(ngrid,nlayer), lscaledEz(ngrid,nlayer)
       
 !JL12 conservation test for mean flow kinetic energy has been disabled temporarily
@@ -401,5 +398,4 @@
       real qsat(ngrid,nlayer) ! Water Vapor Volume Mixing Ratio at saturation (kg/kg_of_air).
       real RH(ngrid,nlayer)   ! Relative humidity.
-      real H2Omaxcol(ngrid)   ! Maximum possible H2O column amount (at 100% saturation) (kg/m2).
       real psat_tmp
       
@@ -407,7 +403,5 @@
       
       ! For Clear Sky Case.
-      real fluxsurf_lw1(ngrid), fluxsurf_sw1(ngrid), fluxsurfabs_sw1(ngrid)  ! For SW/LW flux.
-      real fluxtop_lw1(ngrid), fluxabs_sw1(ngrid)                            ! For SW/LW flux.
-      real albedo_equivalent1(ngrid)                                         ! For Equivalent albedo calculation.
+      real fluxsurfabs_sw1(ngrid)  ! For SW/LW flux.
       real tau_col1(ngrid)                                                   ! For aerosol optical depth diagnostic.
       real OLR_nu1(ngrid,L_NSPECTI), OSR_nu1(ngrid,L_NSPECTV)                ! For Outgoing Radiation diagnostics.
@@ -433,5 +427,5 @@
 
       real :: tsurf2(ngrid)
-      real :: flux_o(ngrid),flux_g(ngrid),fluxgrdocean(ngrid)
+      real :: flux_o(ngrid),flux_g(ngrid)
       real :: flux_sens_lat(ngrid)
       real :: qsurfint(ngrid,nq)
