Index: /LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F
===================================================================
--- /LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F	(revision 453)
+++ /LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F	(revision 454)
@@ -16,5 +16,7 @@
      .                  flux_t,flux_q,flux_u,flux_v,cdragh,cdragm,
      .                  dflux_t,dflux_q,
-     .                  zcoefh,zu1,zv1, t2m, q2m, u10m, v10m)
+cIM cf JLD    .                  zcoefh,zu1,zv1, t2m, q2m, u10m, v10m)
+     .                  zcoefh,zu1,zv1, t2m, q2m, u10m, v10m,
+     .                  fqcalving,ffonte)
 cAA .                  itr, tr, flux_surf, d_tr)
 cAA REM:
@@ -68,4 +70,7 @@
 c dflux_t derive du flux sensible
 c dflux_q derive du flux latent
+c ffonte----Flux thermique utilise pour fondre la neige
+c fqcalving-Flux d'eau "perdue" par la surface et necessaire pour limiter la
+c           hauteur de neige, en kg/m2/s
 cAA on rajoute en output yu1 et yv1 qui sont les vents dans 
 cAA la premiere couche
@@ -93,4 +98,8 @@
       REAL flux_t(klon,klev, nbsrf), flux_q(klon,klev, nbsrf)
       REAL dflux_t(klon), dflux_q(klon)
+cIM cf JLD
+      REAL y_fqcalving(klon), y_ffonte(klon)
+      REAL fqcalving(klon,nbsrf), ffonte(klon,nbsrf)
+
       REAL flux_u(klon,klev, nbsrf), flux_v(klon,klev, nbsrf)
       REAL rugmer(klon), agesno(klon,nbsrf),rugoro(klon)
@@ -175,5 +184,4 @@
       REAL u1lay(klon), v1lay(klon)
       REAL delp(klon,klev)
-      REAL totalflu(klon)
       INTEGER i, k, nsrf 
 cAA   INTEGER it
@@ -368,5 +376,4 @@
 
       DO 99999 nsrf = 1, nbsrf
-       totalflu = radsol
 
 c chercher les indices:
@@ -419,14 +426,5 @@
         ytaux(j) = flux_u(i,1,nsrf)
         ytauy(j) = flux_v(i,1,nsrf)
-c$$$    ysolsw(j) = solsw(i)
-cIM cf. JLD
         ysolsw(j) = solsw(i,nsrf)
-c       ysolsw(j) = (1 - albe(i,nsrf)) 
-c    $      /(1 - pctsrf(i,is_ter) * albe(i,is_ter) 
-c    $      - pctsrf(i, is_lic) *albe(i,is_lic) 
-c    $      - pctsrf(i, is_oce) *albe(i,is_oce)
-c    $      - pctsrf(i, is_sic) *albe(i,is_sic) 
-c    $      ) * solsw(i)
-cIM cf. JLD     ysollw(j) = sollw(i)
         ysollw(j) = sollw(i,nsrf)
         ysollwdown(j) = sollwdown(i)
@@ -435,17 +433,10 @@
         yu1(j) = u1lay(i)
         yv1(j) = v1lay(i)
-c$$$        yrads(j) = totalflu(i)
-cIM cf. JLD
         yrads(j) =  ysolsw(j)+ ysollw(j)
-c       yrads(j) = (1 - albe(i,nsrf)) 
-c    $      /(1 - pctsrf(i,is_ter) * albe(i,is_ter) 
-c    $      - pctsrf(i, is_lic) *albe(i,is_lic) 
-c    $      - pctsrf(i, is_oce) *albe(i,is_oce)
-c    $      - pctsrf(i, is_sic) *albe(i,is_sic) 
-cIM cf. JLD  $      ) * solsw(i) + sollw(i)
-c    $      ) * solsw(i) + ysollw(j)
         ypaprs(j,klev+1) = paprs(i,klev+1)
       END DO
-      IF ( nsrf .eq. is_ter ) THEN 
+C
+C     IF bucket model for continent, copy soil water content
+      IF ( nsrf .eq. is_ter .and. .not. ok_veget ) THEN 
           DO j = 1, knon
             i = ni(j)
@@ -489,5 +480,4 @@
       ENDDO
       ENDDO
-
 c
 c
@@ -522,5 +512,7 @@
      s          pctsrf_new, yagesno,
      s          y_d_t, y_d_q, y_d_ts, yz0_new,
-     s          y_flux_t, y_flux_q, y_dflux_t, y_dflux_q)
+cIM cf JLD    s          y_flux_t, y_flux_q, y_dflux_t, y_dflux_q)
+     s          y_flux_t, y_flux_q, y_dflux_t, y_dflux_q,
+     s          y_fqcalving,y_ffonte)
 c
 c calculer la longueur de rugosite sur ocean
@@ -583,4 +575,7 @@
            rugos(i,nsrf) = yrugm(j)
          endif	
+cIM cf JLD ??
+         fqcalving(i,nsrf) = y_fqcalving(j)        
+         ffonte(i,nsrf) = y_ffonte(j)        
          cdragh(i) = cdragh(i) + ycoefh(j,1)
          cdragm(i) = cdragm(i) + ycoefm(j,1)
@@ -751,5 +746,7 @@
      s                pctsrf_new, agesno,
      s                d_t, d_q, d_ts, z0_new, 
-     s                flux_t, flux_q,dflux_s,dflux_l)
+cIM cf JLD    s                flux_t, flux_q,dflux_s,dflux_l)
+     s                flux_t, flux_q,dflux_s,dflux_l,
+     s                fqcalving,ffonte)
 
       USE interface_surf
@@ -812,4 +809,10 @@
       REAL dflux_s(klon) ! derivee du flux sensible dF/dTs
       REAL dflux_l(klon) ! derivee du flux latent dF/dTs
+cIM cf JLD
+c Flux thermique utiliser pour fondre la neige
+      REAL ffonte(klon)
+c Flux d'eau "perdue" par la surface et nécessaire pour que limiter la
+c hauteur de neige, en kg/m2/s
+      REAL fqcalving(klon)
 c======================================================================
       REAL t_grnd  ! temperature de rappel pour glace de mer
@@ -1028,5 +1031,6 @@
      s evap, fluxsens, fluxlat, dflux_l, dflux_s,              
      s tsol_rad, tsurf_new, alb_new, alblw, emis_new, z0_new, 
-     s pctsrf_new, agesno)
+cIM cf JLD    s pctsrf_new, agesno)
+     s pctsrf_new, agesno,fqcalving,ffonte)
 
 
