Index: /LMDZ4/trunk/libf/phytherm/cpl_mod.F90
===================================================================
--- /LMDZ4/trunk/libf/phytherm/cpl_mod.F90	(revision 836)
+++ /LMDZ4/trunk/libf/phytherm/cpl_mod.F90	(revision 837)
@@ -17,5 +17,5 @@
 ! Use statements
 !*************************************************************************************
-  USE dimphy, ONLY : klon, zmasq
+  USE dimphy, ONLY : klon
   USE mod_phys_lmdz_para
   USE ioipsl
@@ -71,6 +71,4 @@
   REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: pctsrf_sav   
   !$OMP THREADPRIVATE(pctsrf_sav)
-  REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: zmasq2D
-  !$OMP THREADPRIVATE(zmasq2D)
   INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: unity
   !$OMP THREADPRIVATE(unity)
@@ -181,7 +179,4 @@
     ALLOCATE(read_alb_sic(iim, jj_nb), stat = error)
     sum_error = sum_error + error
-    ALLOCATE(zmasq2D(iim, jj_nb), stat = error)
-    sum_error = sum_error + error    
-   
 
     IF (sum_error /= 0) THEN
@@ -202,12 +197,4 @@
     cpl_taux = 0.   ; cpl_tauy = 0.  ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0.
     cpl_rlic2D = 0. ; cpl_windsp = 0.
-
-!*************************************************************************************
-! Transform the land-ocean mask into 2D grid. 
-! Colorize zmasq2D with 99 so that after gath2cpl points not valid can be recognized. 
-!
-!*************************************************************************************
-    zmasq2D(:,:) = 99.
-    CALL gath2cpl(zmasq, zmasq2D, klon, unity)
 
 !*************************************************************************************
@@ -936,16 +923,16 @@
     INTEGER, DIMENSION(iim*(jjm+1))                      :: ndexct
     REAL                                                 :: Up, Down
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_lon, tmp_lat
-    REAL, DIMENSION(iim, jj_nb, 4)                    :: pctsrf2D
-    REAL, DIMENSION(iim, jj_nb)                       :: deno
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_lon, tmp_lat
+    REAL, DIMENSION(iim, jj_nb, 4)                       :: pctsrf2D
+    REAL, DIMENSION(iim, jj_nb)                          :: deno
     CHARACTER(len = 20)                                  :: modname = 'cpl_send_all'
     CHARACTER(len = 80)                                  :: abort_message
    
 ! Variables with fields to coupler
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_taux
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_tauy
-    REAL, DIMENSION(iim, jj_nb)                       :: tmp_calv
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_taux
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_tauy
+    REAL, DIMENSION(iim, jj_nb)                          :: tmp_calv
 ! Table with all fields to send to coupler
-    REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)  :: tab_flds
+    REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)     :: tab_flds
 #ifdef CPP_PARA
     INCLUDE 'mpif.h'
@@ -1036,17 +1023,18 @@
     tmp_tauy(:,:)    = 0.0
     
-    ! For all valid grid cells not entier land
-    WHERE (zmasq2D /= 1. .AND. zmasq2D /=99. )
-       deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) ! fraction oce+seaice
+
+    ! fraction oce+seaice
+    deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) 
+    ! For all valid grid cells containing some fraction of ocean or sea-ice
+    WHERE ( deno(:,:) /= 0 )
+       tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
+       tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
        
-       tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       
-       tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
-       tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
-            cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
+       tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
+       tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
+            cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
     ENDWHERE
 
Index: /LMDZ4/trunk/libf/phytherm/surf_land_orchidee_mod.F90
===================================================================
--- /LMDZ4/trunk/libf/phytherm/surf_land_orchidee_mod.F90	(revision 836)
+++ /LMDZ4/trunk/libf/phytherm/surf_land_orchidee_mod.F90	(revision 837)
@@ -371,5 +371,5 @@
 #endif
 #ifdef ORC_PREPAR
-          ! Interface for version 1.8 or earlier of ORCHIDEE
+          ! Interface for ORCHIDEE version 1.9 or earlier compiled in sequential mode(without preprocessing flag CPP_PARA)
           CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, knon, ktindex, dtime, &
                lrestart_read, lrestart_write, lalo, &
@@ -383,4 +383,5 @@
 
 #else          
+          ! Interface for ORCHIDEE version 1.9 compiled in parallel mode(with preprocessing flag CPP_PARA)
           CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, offset, knon, ktindex, & 
                orch_comm, dtime, lrestart_read, lrestart_write, lalo, &
@@ -406,11 +407,11 @@
     
 #ifdef ORC_PREPAR
-       ! Interface for version 1.8 or earlier of ORCHIDEE
-       CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, knon, ktindex, dtime, &
+       ! Interface for ORCHIDEE version 1.9 or earlier compiled in sequential mode(without preprocessing flag CPP_PARA)
+       CALL intersurf_main (itime+itau_phy, iim, jjm+1, knon, ktindex, dtime, &
             lrestart_read, lrestart_write, lalo, &
             contfrac, neighbours, resolution, date0, &
             zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
             cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-            precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
+            precip_rain, precip_snow, lwdown, swnet, swdown_vrai, ps, &
             evap, fluxsens, fluxlat, coastalflow, riverflow, &
             tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
@@ -418,5 +419,5 @@
        
 #else
-
+       ! Interface for ORCHIDEE version 1.9 compiled in parallel mode(with preprocessing flag CPP_PARA)
        CALL intersurf_main (itime+itau_phy, iim, jjm+1,offset, knon, ktindex, & 
             orch_comm,dtime, lrestart_read, lrestart_write, lalo, &
