Index: LMDZ5/trunk/libf/dyn3d/ce0l.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3d/ce0l.F90	(revision 1508)
+++ LMDZ5/trunk/libf/dyn3d/ce0l.F90	(revision 1511)
@@ -43,4 +43,5 @@
   REAL,    DIMENSION(iip1,jjp1) :: masque
   CHARACTER(LEN=15)             :: calnd
+  REAL,    DIMENSION(iip1,jjp1) :: phis ! geopotentiel au sol
 !-------------------------------------------------------------------------------
   CALL conf_gcm( 99, .TRUE. , clesphy0 )
@@ -80,5 +81,5 @@
   WRITE(lunout,'(//)')
   WRITE(lunout,*) ' interbar = ',interbar
-  CALL etat0_netcdf(interbar,masque,ok_etat0)
+  CALL etat0_netcdf(interbar,masque,phis,ok_etat0)
 
   IF(ok_limit) THEN
@@ -97,5 +98,5 @@
      WRITE(lunout,*) '  ***************************  '
      WRITE(lunout,'(//)')
-     CALL grilles_gcm_netcdf_sub()
+     CALL grilles_gcm_netcdf_sub(masque,phis)
   END IF
 #endif
Index: LMDZ5/trunk/libf/dyn3d/etat0_netcdf.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3d/etat0_netcdf.F90	(revision 1508)
+++ LMDZ5/trunk/libf/dyn3d/etat0_netcdf.F90	(revision 1511)
@@ -4,5 +4,5 @@
 !-------------------------------------------------------------------------------
 !
-SUBROUTINE etat0_netcdf(ib, masque, letat0)
+SUBROUTINE etat0_netcdf(ib, masque, phis, letat0)
 !
 !-------------------------------------------------------------------------------
@@ -37,4 +37,5 @@
   LOGICAL,                    INTENT(IN)    :: ib     ! barycentric interpolat.
   REAL, DIMENSION(iip1,jjp1), INTENT(INOUT) :: masque ! land mask
+  REAL, DIMENSION(iip1,jjp1), INTENT(OUT)   :: phis   ! geopotentiel au sol
   LOGICAL,                    INTENT(IN)    :: letat0 ! F: masque only required
 #ifndef CPP_EARTH
@@ -51,5 +52,5 @@
   REAL,    DIMENSION(klon)                 :: tsol, qsol
   REAL,    DIMENSION(klon)                 :: sn, rugmer, run_off_lic_0
-  REAL,    DIMENSION(iip1,jjp1)            :: orog, rugo, psol, phis
+  REAL,    DIMENSION(iip1,jjp1)            :: orog, rugo, psol
   REAL,    DIMENSION(iip1,jjp1,llm+1)      :: p3d
   REAL,    DIMENSION(iip1,jjp1,llm)        :: uvent, t3d, tpot, qsat, qd
Index: LMDZ5/trunk/libf/dyn3d/grilles_gcm_netcdf_sub.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3d/grilles_gcm_netcdf_sub.F90	(revision 1508)
+++ LMDZ5/trunk/libf/dyn3d/grilles_gcm_netcdf_sub.F90	(revision 1511)
@@ -7,5 +7,5 @@
 ! part in the program create_fausse_var.
 !
-SUBROUTINE grilles_gcm_netcdf_sub
+SUBROUTINE grilles_gcm_netcdf_sub(masque,phis)
 
   IMPLICIT NONE
@@ -19,11 +19,16 @@
   INCLUDE "serre.h"
 
+
+  REAL,DIMENSION(iip1,jjp1),INTENT(IN)  :: masque ! masque terre/mer
+  REAL,DIMENSION(iip1,jjp1),INTENT(IN)  :: phis   ! geopotentiel au sol
+
   REAL temp(iim+1,jjm+1)
   ! Attributs netcdf sortie
   INTEGER ncid_out,rcode_out
-  INTEGER out_lonuid,out_lonvid,out_latuid,out_latvid
+  INTEGER out_lonuid,out_lonvid,out_latuid,out_latvid,out_levid
   INTEGER out_varid
   INTEGER out_lonudim,out_lonvdim
   INTEGER out_latudim,out_latvdim,out_dim(3)
+  INTEGER out_levdim
 
   INTEGER, PARAMETER :: longcles = 20
@@ -33,10 +38,15 @@
 
   INTEGER status,i,j
-  REAL rlatudeg(jjp1),rlatvdeg(jjm)
+  REAL rlatudeg(jjp1),rlatvdeg(jjm),rlevdeg(llm)
   REAL rlonudeg(iip1),rlonvdeg(iip1)
 
   REAL dlon1(iip1),dlon2(iip1),dlat1(jjp1),dlat2(jjp1)
   REAL acoslat,dxkm,dykm,resol(iip1,jjp1)
-
+  REAL,DIMENSION(iip1,jjp1)  :: phis_loc
+  INTEGER masque_int(iip1,jjp1)
+  INTEGER :: phis_id
+  INTEGER :: area_id
+  INTEGER :: mask_id
+  
   rad = 6400000
   omeg = 7.272205e-05
@@ -165,5 +175,48 @@
 #endif
 
-
+  ! On re-ouvre le fichier pour rajouter 4 nouvelles variables necessaire pour INCA
+! lev - phis - aire - mask
+  rlevdeg(:) = presnivs
+  phis_loc(:,:) = phis(:,:)/g
+
+! niveaux de pression verticaux
+  status = NF_REDEF (ncid_out)
+  status=NF_DEF_DIM(ncid_out,'lev',llm,out_levdim)
+  
+! fields
+  out_dim(1)=out_lonvdim
+  out_dim(2)=out_latudim
+
+  status = nf_def_var(ncid_out,'phis',NF_FLOAT,2,out_dim,phis_id)
+  CALL handle_err(status)
+  status = nf_def_var(ncid_out,'aire',NF_FLOAT,2,out_dim,area_id)
+  CALL handle_err(status)
+  status = nf_def_var(ncid_out,'mask',NF_INT  ,2,out_dim,mask_id)
+  CALL handle_err(status)
+
+  status=NF_ENDDEF(ncid_out)
+
+  ! ecriture des variables
+#ifdef NC_DOUBLE
+  status=NF_PUT_VARA_DOUBLE(ncid_out,out_levid,1,llm,rlevdeg)
+#else
+  status=NF_PUT_VARA_REAL(ncid_out,out_levid,1,llm,rlevdeg)
+#endif
+
+  start(1)=1
+  start(2)=1
+  start(3)=1
+  start(4)=0
+  COUNT(1)=iip1
+  COUNT(2)=jjp1
+  COUNT(3)=1
+  COUNT(4)=0
+
+  status = nf_put_vara_double(ncid_out, phis_id,start,count, phis_loc)
+  status = nf_put_vara_double(ncid_out, area_id,start,count, aire)
+  masque_int(:,:) = nINT(masque(:,:))
+  status = nf_put_vara_int(ncid_out, mask_id,start,count,masque_int)
+  CALL handle_err(status)
+  
   ! fermeture du fichier netcdf
   CALL ncclos(ncid_out,rcode_out)
