Index: /LMDZ4/trunk/libf/dyn3d/etat0_netcdf.F
===================================================================
--- /LMDZ4/trunk/libf/dyn3d/etat0_netcdf.F	(revision 987)
+++ /LMDZ4/trunk/libf/dyn3d/etat0_netcdf.F	(revision 988)
@@ -4,5 +4,5 @@
 c
 c
-      SUBROUTINE etat0_netcdf (interbar, masque, pctsrf)
+      SUBROUTINE etat0_netcdf (interbar, masque)
     
       USE startvar
@@ -12,5 +12,6 @@
       USE pbl_surface_mod
       USE ocean_slab_mod
-      USE surface_data
+      USE surface_data,     ONLY : ocean, ok_veget
+      USE phys_state_var_mod
       !
       IMPLICIT NONE
@@ -45,18 +46,10 @@
       REAL :: alblw(klon,nbsrf)
       REAL :: tsoil(klon,nsoilmx,nbsrf) 
-      REAL :: radsol(klon),rain_fall(klon), snow_fall(klon)
-      REAL :: solsw(klon), sollw(klon), fder(klon)
 cIM "slab" ocean
       REAL :: tslab(klon), seaice(klon)
       REAL :: frugs(klon,nbsrf), agesno(klon,nbsrf)
       REAL :: rugmer(klon)
-      REAL :: zmea(iip1*jjp1), zstd(iip1*jjp1)
-      REAL :: zsig(iip1*jjp1), zgam(iip1*jjp1), zthe(iip1*jjp1)
-      REAL :: zpic(iip1*jjp1), zval(iip1*jjp1), rugsrel(iip1*jjp1)
       REAL :: qd(iip1, jjp1, llm)
-      REAL :: pctsrf(klon, nbsrf)
-      REAL :: t_ancien(klon,klev), q_ancien(klon,klev)      !
       REAL :: run_off_lic_0(klon)
-      real :: clwcon(klon,klev),rnebcon(klon,klev),ratqs(klon,klev)
       ! declarations pour lecture glace de mer
       REAL :: rugv(klon)
@@ -102,6 +95,7 @@
       REAL :: w(ip1jmp1,llm)
       REAL ::phystep
-      INTEGER :: radpas
-       real zrel(iip1*jjp1),chmin,chmax
+      REAL :: rugsrel(iip1*jjp1)
+      REAL :: fder(klon)
+      real zrel(iip1*jjp1),chmin,chmax
 
       CHARACTER*80 :: visu_file
@@ -119,8 +113,22 @@
       real zx_tmp_2d(iim,jjp1)
 
-      REAL, DIMENSION(klon,klev,nbsrf) :: pbl_tke ! turb kinetic energy
-      REAL, DIMENSION(klon) :: zmax0, f0 
-      REAL, DIMENSION(klon,klev) :: ema_work1, ema_work2
       REAL :: dummy(klon, nbsrf)
+
+      logical              :: ok_newmicro
+      integer              :: iflag_radia
+      logical              :: ok_journe, ok_mensuel, ok_instan, ok_hf
+      LOGICAL              :: ok_ade, ok_aie, aerosol_couple
+      REAL                 :: bl95_b0, bl95_b1
+      real                 :: fact_cldcon, facttemps,ratqsbas,ratqshaut
+      integer              :: iflag_cldcon
+      integer              :: iflag_ratqs
+      integer :: iflag_coupl
+      integer :: iflag_clos
+      integer :: iflag_wake
+      integer :: iflag_thermals,nsplit_thermals
+      real    :: tau_thermals
+      REAL      :: solarlong0
+      real :: seuil_inversion
+
       !
       !   Constantes 
@@ -144,4 +152,14 @@
 !      CALL defrun_new(99,.TRUE.,clesphy0)
       CALL conf_gcm( 99, .TRUE. , clesphy0 )
+      call conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, ok_instan, &
+     &                 ok_hf,                                           &
+     &                 solarlong0,seuil_inversion,                      &
+     &                 fact_cldcon, facttemps,ok_newmicro,iflag_radia,  &
+     &                 iflag_cldcon,                                    &
+     &                 iflag_ratqs,ratqsbas,ratqshaut,                  &
+     &                 ok_ade, ok_aie, aerosol_couple,                  &
+     &                 bl95_b0, bl95_b1,                                &
+     &                 iflag_thermals,nsplit_thermals,tau_thermals,     &
+     &                 iflag_coupl,iflag_clos,iflag_wake )
 
       dtvr   = daysec/FLOAT(day_step)
@@ -152,4 +170,5 @@
       !
       CALL inifilr()
+      CALL phys_state_var_init()
       !
       latfi(1) = ASIN(1.0)
@@ -175,4 +194,27 @@
       ENDDO
       !
+      rlat(1) = ASIN(1.0)
+      DO j = 2, jjm
+        DO i = 1, iim
+          rlat((j-2)*iim+1+i)=  rlatu(j)
+        ENDDO
+      ENDDO
+      rlat(klon) = - ASIN(1.0)
+      !
+      rlon(1) = 0.0
+      DO j = 2, jjm
+        DO i = 1, iim
+          rlon((j-2)*iim+1+i) =  rlonv(i)
+        ENDDO
+      ENDDO
+      rlon(klon) = 0.0
+      !
+      xpi = 2.0 * ASIN(1.0)
+      DO ig = 1, klon
+        rlat(ig) = rlat(ig) * 180.0 / xpi
+        rlon(ig) = rlon(ig) * 180.0 / xpi
+      ENDDO
+      !
+      
 
 
@@ -639,17 +681,17 @@
 c tsol, qsol, sn,albe, evap,tsoil,rain_fall, snow_fall,solsw, sollw,frugs
 c
-      tsolsrf(:,is_ter) = tsol
-      tsolsrf(:,is_lic) = tsol
-      tsolsrf(:,is_oce) = tsol
-      tsolsrf(:,is_sic) = tsol
+      ftsol(:,is_ter) = tsol
+      ftsol(:,is_lic) = tsol
+      ftsol(:,is_oce) = tsol
+      ftsol(:,is_sic) = tsol
       snsrf(:,is_ter) = sn
       snsrf(:,is_lic) = sn
       snsrf(:,is_oce) = sn
       snsrf(:,is_sic) = sn
-      albe(:,is_ter) = 0.08
-      albe(:,is_lic) = 0.6
-      albe(:,is_oce) = 0.5
-      albe(:,is_sic) = 0.6
-      alblw = albe
+      falb1(:,is_ter) = 0.08
+      falb1(:,is_lic) = 0.6
+      falb1(:,is_oce) = 0.5
+      falb1(:,is_sic) = 0.6
+      falb2 = falb1
       evap(:,:) = 0.
       qsolsrf(:,is_ter) = 150
@@ -669,5 +711,5 @@
       agesno = 0.
 cIM "slab" ocean
-      tslab(1:klon) = tsolsrf(1:klon,is_oce)
+      tslab(1:klon) = ftsol(1:klon,is_oce)
       seaice = 0. !kg m-2
 c
@@ -681,4 +723,5 @@
       ratqs = 0.0
       run_off_lic_0 = 0.0 
+      rugoro = 0.0
 
 c
@@ -693,4 +736,9 @@
       ema_work1(:,:) = 0.
       ema_work2(:,:) = 0.
+      wake_deltat(:,:) = 0.
+      wake_deltaq(:,:) = 0.
+      wake_s(:) = 0.
+      wake_cstar(:) = 0.
+      wake_fip(:) = 0.
 
       call fonte_neige_init(run_off_lic_0)
