Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/coefcdrag.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/coefcdrag.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/coefcdrag.F90	(revision 1073)
@@ -1,5 +1,2 @@
-!
-! $Header$
-!
 !
 !
@@ -54,5 +51,5 @@
       include "indicesol.h"
 ! Quelques constantes :
-      REAL, parameter :: RKAR=0.40, CB=5.0, CC=5.0, CD=5.0
+      REAL, parameter :: RKAR=0.40, CB=5.0, CC=5.0, CD=5.0, cepdu2=(0.1)**2
 !
 ! Variables locales :
@@ -72,5 +69,5 @@
 !
        zdphi(i) = zgeop(i)
-       zdu2(i) = speed(i)**2
+       zdu2(i) = max(cepdu2,speed(i)**2)
        pref(i) = exp(log(psol(i)) - zdphi(i)/(RD*t(i)* &
                  (1.+ RETV * max(q(i),0.0))))
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/conf_phys.F90	(revision 1073)
@@ -1,4 +1,2 @@
-!
-! $Header$
 !
 !
@@ -14,4 +12,5 @@
 
    use IOIPSL
+   use surface_data, ONLY : version_ocean
    implicit none
 
@@ -33,4 +32,5 @@
 !
 ! ocean:      type d'ocean (force, slab, couple)
+! version_ocean:   version d'ocean (opa8/nemo pour ocean=couple)
 ! ok_veget:   type de modele de vegetation
 ! ok_journe:  sorties journalieres
@@ -52,5 +52,5 @@
   integer              :: iflag_cldcon
 
-  character (len = 6),SAVE  :: ocean_omp
+  character (len = 6),SAVE  :: ocean_omp, version_ocean_omp
   logical,SAVE              :: ok_veget_omp, ok_newmicro_omp
   logical,SAVE        :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp        
@@ -105,4 +105,12 @@
   ocean_omp = 'force '
   call getin('OCEAN', ocean_omp)
+!
+!Config Key  = version_ocean 
+!Config Desc = Version d'ocean
+!Config Def  = xxxxxx
+!Config Help = Version d'ocean utilise: opa8/nemo/xxxxxx
+!
+  version_ocean_omp = 'opa8'
+  call getin('version_ocean', version_ocean_omp)
 !
 !Config Key  = VEGET 
@@ -849,4 +857,5 @@
 
     ocean = ocean_omp
+    version_ocean = version_ocean_omp
     ok_veget = ok_veget_omp
     ok_newmicro = ok_newmicro_omp
@@ -886,4 +895,10 @@
     ok_lic_melt = ok_lic_melt_omp
 
+! Test of coherence between ocean and version_ocean
+    IF (ocean=='couple' .AND. (version_ocean/='opa8' .AND. version_ocean/='nemo') ) THEN
+       WRITE(numout,*)' ERROR version_ocean=',version_ocean,' not valid in coupled configuration'
+       CALL abort_gcm('conf_phys','version_ocean not valid',1)
+    END IF
+
 !$OMP MASTER
 
@@ -891,4 +906,5 @@
   write(numout,*)' Configuration des parametres de la physique: '
   write(numout,*)' Config ocean = ', ocean
+  write(numout,*)' Version ocean = ', version_ocean, ' (valable si config ocean=couple)'
   write(numout,*)' Config veget = ', ok_veget
   write(numout,*)' Sortie journaliere = ', ok_journe
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/cpl_mod.F90	(revision 1073)
@@ -1,4 +1,2 @@
-!
-! $Header$
 !
 MODULE cpl_mod
@@ -262,4 +260,5 @@
 ! 4 fields : read_sst, read_sic, read_sit and read_alb_sic. 
 
+    USE surface_data, ONLY : version_ocean
     INCLUDE "indicesol.h"
     INCLUDE "temps.h"
@@ -306,8 +305,15 @@
 
 ! Save each field in a 2D array. 
-    read_sst(:,:)     = tab_read_flds(:,:,1)  ! Sea surface temperature
-    read_sic(:,:)     = tab_read_flds(:,:,2)  ! Sea ice concentration
-    read_alb_sic(:,:) = tab_read_flds(:,:,3)  ! Albedo at sea ice
-    read_sit(:,:)     = tab_read_flds(:,:,4)  ! Sea ice temperature
+    IF (version_ocean=='nemo') THEN
+       read_sst(:,:)     = tab_read_flds(:,:,1)  ! Sea surface temperature
+       read_sic(:,:)     = tab_read_flds(:,:,2)  ! Sea ice concentration
+       read_sit(:,:)     = tab_read_flds(:,:,3)  ! Sea ice temperature
+       read_alb_sic(:,:) = tab_read_flds(:,:,4)  ! Albedo at sea ice
+    ELSE IF (version_ocean=='opa8') THEN
+       read_sst(:,:)     = tab_read_flds(:,:,1)  ! Sea surface temperature
+       read_sic(:,:)     = tab_read_flds(:,:,2)  ! Sea ice concentration
+       read_alb_sic(:,:) = tab_read_flds(:,:,3)  ! Albedo at sea ice
+       read_sit(:,:)     = tab_read_flds(:,:,4)  ! Sea ice temperature
+    ENDIF
 
 !*************************************************************************************
@@ -902,4 +908,5 @@
 ! all calculations at the different surfaces have to be done before. 
 !    
+    USE surface_data, ONLY : version_ocean
 ! Some includes
 !*************************************************************************************
@@ -950,15 +957,27 @@
 !
 !*************************************************************************************
-    tab_flds(:,:,7)  = cpl_windsp2D(:,:)
-    tab_flds(:,:,8)  = cpl_sols2D(:,:,2)
-    tab_flds(:,:,9)  = cpl_sols2D(:,:,1)
-    tab_flds(:,:,10) = cpl_nsol2D(:,:,2)
-    tab_flds(:,:,11) = cpl_nsol2D(:,:,1)
-    tab_flds(:,:,12) = cpl_fder2D(:,:,2)
-    tab_flds(:,:,13) = cpl_evap2D(:,:,2)
-    tab_flds(:,:,14) = cpl_evap2D(:,:,1)
-    tab_flds(:,:,17) = cpl_rcoa2D(:,:)
-    tab_flds(:,:,18) = cpl_rriv2D(:,:)
-    
+    IF (version_ocean=='nemo') THEN
+       tab_flds(:,:,7)  = cpl_windsp2D(:,:)
+       tab_flds(:,:,14) = cpl_sols2D(:,:,2)
+       tab_flds(:,:,12) = cpl_sols2D(:,:,1)
+       tab_flds(:,:,15) = cpl_nsol2D(:,:,2)
+       tab_flds(:,:,13) = cpl_nsol2D(:,:,1)
+       tab_flds(:,:,16) = cpl_fder2D(:,:,2)
+       tab_flds(:,:,11) = cpl_evap2D(:,:,2)
+       tab_flds(:,:,18) = cpl_rriv2D(:,:)
+       tab_flds(:,:,19) = cpl_rcoa2D(:,:)
+    ELSE IF (version_ocean=='opa8') THEN
+       tab_flds(:,:,7)  = cpl_windsp2D(:,:)
+       tab_flds(:,:,8)  = cpl_sols2D(:,:,2)
+       tab_flds(:,:,9)  = cpl_sols2D(:,:,1)
+       tab_flds(:,:,10) = cpl_nsol2D(:,:,2)
+       tab_flds(:,:,11) = cpl_nsol2D(:,:,1)
+       tab_flds(:,:,12) = cpl_fder2D(:,:,2)
+       tab_flds(:,:,13) = cpl_evap2D(:,:,2)
+       tab_flds(:,:,14) = cpl_evap2D(:,:,1)
+       tab_flds(:,:,17) = cpl_rcoa2D(:,:)
+       tab_flds(:,:,18) = cpl_rriv2D(:,:)
+    ENDIF
+
 !*************************************************************************************
 ! Transform the fraction of sub-surfaces from 1D to 2D array
@@ -1008,5 +1027,9 @@
       
 
-    tab_flds(:,:,19) = tmp_calv(:,:)
+    IF (version_ocean=='nemo') THEN
+       tab_flds(:,:,17) = tmp_calv(:,:)
+    ELSE IF (version_ocean=='opa8') THEN
+       tab_flds(:,:,19) = tmp_calv(:,:)
+    ENDIF
 
 !*************************************************************************************
@@ -1018,25 +1041,44 @@
 !
 !*************************************************************************************    
-    tab_flds(:,:,15) = 0.0
-    tab_flds(:,:,16) = 0.0
-    tmp_taux(:,:)    = 0.0
-    tmp_tauy(:,:)    = 0.0
-    
-
     ! 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(:,:)
+
+    IF (version_ocean=='nemo') THEN
+       tab_flds(:,:,10) = 0.0
+       tmp_taux(:,:)    = 0.0
+       tmp_tauy(:,:)    = 0.0
+       ! For all valid grid cells containing some fraction of ocean or sea-ice
+       WHERE ( deno(:,:) /= 0 )
+          tab_flds(:,:,10) = 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(:,:)
+       ENDWHERE
+       tab_flds(:,:,8) = (cpl_evap2D(:,:,1) - ( cpl_rain2D(:,:,1) + cpl_snow2D(:,:,1)))
+       tab_flds(:,:,9) = (cpl_evap2D(:,:,2) - ( cpl_rain2D(:,:,2) + cpl_snow2D(:,:,2)))
        
-       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
-
+    ELSE IF (version_ocean=='opa8') THEN
+       tab_flds(:,:,15) = 0.0
+       tab_flds(:,:,16) = 0.0
+       tmp_taux(:,:)    = 0.0
+       tmp_tauy(:,:)    = 0.0
+       
+       ! 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(:,:)
+          
+          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
+    ENDIF
+    
 !*************************************************************************************
 ! Transform the wind components from local atmospheric 2D coordinates to geocentric 
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/oasis.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/oasis.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/oasis.F90	(revision 1073)
@@ -1,4 +1,2 @@
-!
-! $Header$
 !
 MODULE oasis
@@ -57,4 +55,5 @@
 !     LF 09/2003
 !
+    USE surface_data, ONLY : version_ocean
     INCLUDE "dimensions.h"
 
@@ -136,24 +135,47 @@
     cl_writ(6)='COTAUZZV'
     cl_writ(7)='COWINDSP'
-    cl_writ(8)='COSHFICE'
-    cl_writ(9)='COSHFOCE'
-    cl_writ(10)='CONSFICE'
-    cl_writ(11)='CONSFOCE'
-    cl_writ(12)='CODFLXDT'
-    cl_writ(13)='COTFSICE'
-    cl_writ(14)='COTFSOCE'
-    cl_writ(15)='COTOLPSU'
-    cl_writ(16)='COTOSPSU'
-    cl_writ(17)='CORUNCOA'
-    cl_writ(18)='CORIVFLU'
-    cl_writ(19)='COCALVIN'
+
+    IF (version_ocean=='nemo') THEN
+      cl_writ(8) ='COPEFWAT'
+      cl_writ(9) ='COPEFICE'
+      cl_writ(10)='COTOSPSU'
+      cl_writ(11)='COICEVAP'
+      cl_writ(12)='COSWFLDO'
+      cl_writ(13)='CONSFLDO'
+      cl_writ(14)='COSHFLIC'
+      cl_writ(15)='CONSFLIC'
+      cl_writ(16)='CODFLXDT'
+      cl_writ(17)='CRWOCEIS'
+      cl_writ(18)='CRWOCERD'
+      cl_writ(19)='CRWOCECD'
+    ELSE IF (version_ocean=='opa8') THEN
+       cl_writ(8)='COSHFICE'
+       cl_writ(9)='COSHFOCE'
+       cl_writ(10)='CONSFICE'
+       cl_writ(11)='CONSFOCE'
+       cl_writ(12)='CODFLXDT'
+       cl_writ(13)='COTFSICE'
+       cl_writ(14)='COTFSOCE'
+       cl_writ(15)='COTOLPSU'
+       cl_writ(16)='COTOSPSU'
+       cl_writ(17)='CORUNCOA'
+       cl_writ(18)='CORIVFLU'
+       cl_writ(19)='COCALVIN'
+    ENDIF
 !
 !     Define symbolic name for fields exchanged from coupler to atmosphere,
 !         must be the same as (2) of the field  definition in namcouple:
 !
-    cl_read(1)='SISUTESW'
-    cl_read(2)='SIICECOV'
-    cl_read(3)='SIICEALW'
-    cl_read(4)='SIICTEMW'
+    IF (version_ocean=='nemo') THEN
+       cl_read(1)='SISUTESW'
+       cl_read(2)='SIICECOV'
+       cl_read(4)='SIICEALW'
+       cl_read(3)='SIICTEMW'
+    ELSE IF (version_ocean=='opa8') THEN
+       cl_read(1)='SISUTESW'
+       cl_read(2)='SIICECOV'
+       cl_read(3)='SIICEALW'
+       cl_read(4)='SIICTEMW'
+    ENDIF
     
     il_var_nodims(1) = 2
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surf_land_orchidee_mod.F90	(revision 1073)
@@ -1,4 +1,2 @@
-!
-! $Header$
 !
 MODULE surf_land_orchidee_mod
@@ -269,4 +267,6 @@
        ENDIF
    
+       CALL bcast(lon_scat)
+       CALL bcast(lat_scat)
 
 !
Index: LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surface_data.F90
===================================================================
--- LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surface_data.F90	(revision 954)
+++ LMDZ4/branches/LMDZ4_V3_patches/libf/phylmd/surface_data.F90	(revision 1073)
@@ -1,4 +1,2 @@
-!
-! $Header$
 !
 MODULE surface_data
@@ -15,3 +13,7 @@
   !$OMP THREADPRIVATE(ocean)
 
+  ! if ocean=couple : version_ocean=opa8 ou nemo
+  CHARACTER(len=6), SAVE :: version_ocean 
+  !$OMP THREADPRIVATE(version_ocean)
+
 END MODULE surface_data
