Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dynetat0.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dynetat0.F	(revision 892)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dynetat0.F	(revision 907)
@@ -57,4 +57,5 @@
       INTEGER ierr, nid, nvarid
 
+      character(len=12) :: start_file_type="earth" ! default start file type
       INTEGER idecal
 
@@ -86,4 +87,5 @@
       if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then
           write(lunout,*)'dynetat0 : Planeto-like start file'
+          start_file_type="planeto"
           idecal = 4
           annee_ref  = 2000
@@ -98,5 +100,10 @@
       jm         = tab_cntrl(2)
       lllm       = tab_cntrl(3)
-      day_ref    = tab_cntrl(4)
+      if (start_file_type.eq."earth") then
+        day_ref    = tab_cntrl(4)
+      else
+        day_ini    = tab_cntrl(4)
+        day_ref=0
+      endif
       rad        = tab_cntrl(idecal+1)
       omeg       = tab_cntrl(idecal+2)
@@ -131,7 +138,13 @@
       ENDIF
 
-      day_ini = tab_cntrl(30)
-      itau_dyn = tab_cntrl(31)
-      start_time = tab_cntrl(32)
+      if (start_file_type.eq."earth") then
+        day_ini = tab_cntrl(30)
+        itau_dyn = tab_cntrl(31)
+        start_time = tab_cntrl(32)
+      else
+        day_ini=tab_cntrl(4)
+        itau_dyn=0
+        start_time=0
+      endif
 c   .................................................................
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem.F	(revision 892)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem.F	(revision 907)
@@ -9,5 +9,6 @@
       USE infotrac
       use netcdf95, only: NF95_PUT_VAR
- 
+      use control_mod, only : planet_type
+
       IMPLICIT NONE
 c=======================================================================
@@ -58,4 +59,6 @@
       character*30 unites
 
+      character(len=12) :: start_file_type="earth" ! default start file type
+      INTEGER idecal
 
 c-----------------------------------------------------------------------
@@ -71,4 +74,15 @@
       jjour0=1
 #endif        
+
+      !!! AS: idecal is a hack to be able to read planeto starts...
+      !!!     .... while keeping everything OK for LMDZ EARTH
+      if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then
+          write(lunout,*) trim(modname),' : Planeto-like start file'
+          start_file_type="planeto"
+          idecal = 4
+      else
+          write(lunout,*) trim(modname),' : Earth-like start file'
+          idecal = 5
+      endif
 
       DO l=1,length
@@ -78,49 +92,55 @@
        tab_cntrl(2)  = REAL(jjm)
        tab_cntrl(3)  = REAL(llm)
-       tab_cntrl(4)  = REAL(day_ref)
+       if (start_file_type.eq."earth") then
+         tab_cntrl(4)=REAL(day_ref)
+       else
+         tab_cntrl(4)=REAL(day_end)
+       endif
        tab_cntrl(5)  = REAL(annee_ref)
-       tab_cntrl(6)  = rad
-       tab_cntrl(7)  = omeg
-       tab_cntrl(8)  = g
-       tab_cntrl(9)  = cpp
-       tab_cntrl(10) = kappa
-       tab_cntrl(11) = daysec
-       tab_cntrl(12) = dtvr
-       tab_cntrl(13) = etot0
-       tab_cntrl(14) = ptot0
-       tab_cntrl(15) = ztot0
-       tab_cntrl(16) = stot0
-       tab_cntrl(17) = ang0
-       tab_cntrl(18) = pa
-       tab_cntrl(19) = preff
+       tab_cntrl(idecal+1)  = rad
+       tab_cntrl(idecal+2)  = omeg
+       tab_cntrl(idecal+3)  = g
+       tab_cntrl(idecal+4)  = cpp
+       tab_cntrl(idecal+5) = kappa
+       tab_cntrl(idecal+6) = daysec
+       tab_cntrl(idecal+7) = dtvr
+       tab_cntrl(idecal+8) = etot0
+       tab_cntrl(idecal+9) = ptot0
+       tab_cntrl(idecal+10) = ztot0
+       tab_cntrl(idecal+11) = stot0
+       tab_cntrl(idecal+12) = ang0
+       tab_cntrl(idecal+13) = pa
+       tab_cntrl(idecal+14) = preff
 c
 c    .....    parametres  pour le zoom      ......   
 
-       tab_cntrl(20)  = clon
-       tab_cntrl(21)  = clat
-       tab_cntrl(22)  = grossismx
-       tab_cntrl(23)  = grossismy
+       tab_cntrl(idecal+15)  = clon
+       tab_cntrl(idecal+16)  = clat
+       tab_cntrl(idecal+17)  = grossismx
+       tab_cntrl(idecal+18)  = grossismy
 c
       IF ( fxyhypb )   THEN
-       tab_cntrl(24) = 1.
-       tab_cntrl(25) = dzoomx
-       tab_cntrl(26) = dzoomy
-       tab_cntrl(27) = 0.
-       tab_cntrl(28) = taux
-       tab_cntrl(29) = tauy
+       tab_cntrl(idecal+19) = 1.
+       tab_cntrl(idecal+20) = dzoomx
+       tab_cntrl(idecal+21) = dzoomy
+       tab_cntrl(idecal+22) = 0.
+       tab_cntrl(idecal+23) = taux
+       tab_cntrl(idecal+24) = tauy
       ELSE
-       tab_cntrl(24) = 0.
-       tab_cntrl(25) = dzoomx
-       tab_cntrl(26) = dzoomy
-       tab_cntrl(27) = 0.
-       tab_cntrl(28) = 0.
-       tab_cntrl(29) = 0.
-       IF( ysinus )  tab_cntrl(27) = 1.
-      ENDIF
-
-       tab_cntrl(30) = REAL(iday_end)
-       tab_cntrl(31) = REAL(itau_dyn + itaufin)
+       tab_cntrl(idecal+19) = 0.
+       tab_cntrl(idecal+20) = dzoomx
+       tab_cntrl(idecal+21) = dzoomy
+       tab_cntrl(idecal+22) = 0.
+       tab_cntrl(idecal+23) = 0.
+       tab_cntrl(idecal+24) = 0.
+       IF( ysinus )  tab_cntrl(idecal+22) = 1.
+      ENDIF
+
+      if (start_file_type.eq."earth") then
+       tab_cntrl(idecal+25) = REAL(iday_end)
+       tab_cntrl(idecal+26) = REAL(itau_dyn + itaufin)
 c start_time: start_time of simulation (not necessarily 0.)
-       tab_cntrl(32) = start_time
+       tab_cntrl(idecal+27) = start_time
+      endif
 c
 c    .........................................................
@@ -143,12 +163,23 @@
 c Definir les dimensions du fichiers:
 c
-      ierr = NF_DEF_DIM (nid, "index", length, idim_index)
-      ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
-      ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu)
-      ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv)
-      ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
-      ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s)
-      ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig)
-      ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim)
+      if (start_file_type.eq."earth") then
+        ierr = NF_DEF_DIM (nid, "index", length, idim_index)
+        ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
+        ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu)
+        ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv)
+        ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
+        ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s)
+        ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig)
+        ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim)
+      else
+        ierr = NF_DEF_DIM (nid, "index", length, idim_index)
+        ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
+        ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu)
+        ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv)
+        ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
+        ierr = NF_DEF_DIM (nid, "altitude", llm, idim_s)
+        ierr = NF_DEF_DIM (nid, "interlayer", llmp1, idim_sig)
+        ierr = NF_DEF_DIM (nid, "Time", NF_UNLIMITED, idim_tim)
+      endif
 c
       ierr = NF_ENDDEF(nid) ! sortir du mode de definition
@@ -221,29 +252,31 @@
       call NF95_PUT_VAR(nid,nvarid,rlatv)
 c
-      ierr = NF_REDEF (nid)
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid)
-#endif
-cIM 220306 END
-      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28,
+      if (start_file_type.eq."earth") then
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28,
      .                       "Numero naturel des couches s")
-      ierr = NF_ENDDEF(nid)
-      call NF95_PUT_VAR(nid,nvarid,nivsigs)
-c
-      ierr = NF_REDEF (nid)
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)
-#endif
-cIM 220306 END
-      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,nivsigs)
+c
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,
      .                       "Numero naturel des couches sigma")
-      ierr = NF_ENDDEF(nid)
-      call NF95_PUT_VAR(nid,nvarid,nivsig)
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,nivsig)
+      endif ! of if (start_file_type.eq."earth")
 c
       ierr = NF_REDEF (nid)
@@ -273,4 +306,32 @@
       call NF95_PUT_VAR(nid,nvarid,bp)
 c
+      if (start_file_type.ne."earth") then
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 37,
+     .                       "Coef AS: hybrid pressure at midlayers")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,aps)
+c
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 34,
+     .                       "Coef BS: hybrid sigma at midlayers")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,bps)
+      endif ! of if (start_file_type.ne."earth")
+c
       ierr = NF_REDEF (nid)
 cIM 220306 BEG
@@ -283,4 +344,44 @@
       ierr = NF_ENDDEF(nid)
       call NF95_PUT_VAR(nid,nvarid,presnivs)
+c
+      if (start_file_type.ne."earth") then
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid)
+#else
+        ierr = NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid)
+#endif
+        ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
+     .        "North latitude")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,rlatu*180/pi)
+c
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,idim_rlonv,nvarid)
+#else
+        ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,idim_rlonv,nvarid)
+#endif
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
+     .        "East longitude")
+        ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,rlonv*180/pi)
+c
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1,
+     .       idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1,
+     .       idim_s,nvarid)
+#endif
+        ierr = NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,pseudoalt)
+      endif ! of if (start_file_type.ne."earth")
 c
 c Coefficients de passage cov. <-> contra. <--> naturel
@@ -354,11 +455,19 @@
       ierr = NF_REDEF (nid) ! entrer dans le mode de definition
 c
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid)
-#endif
-cIM 220306 END
+      if (start_file_type.eq."earth") then
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid)
+#endif
+cIM 220306 END
+      else ! start_file_type=="planeto"
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid)
+#endif
+      endif ! of if (start_file_type.eq."earth")
       ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19,
      .                       "Temps de simulation")
@@ -465,8 +574,11 @@
       RETURN
       END
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
       SUBROUTINE dynredem1(fichnom,time,
      .                     vcov,ucov,teta,q,masse,ps)
       USE infotrac
-      USE control_mod
+      USE control_mod, only : planet_type
       use netcdf, only: NF90_get_VAR
       use netcdf95, only: NF95_PUT_VAR
@@ -501,5 +613,5 @@
       PARAMETER (length = 100)
       REAL tab_cntrl(length) ! tableau des parametres du run
-      character*20 modname
+      character(len=*),parameter :: modname='dynredem1'
       character*80 abort_message
 c
@@ -507,9 +619,16 @@
       SAVE nb
       DATA nb / 0 /
-
-      modname = 'dynredem1'
+      character(len=12) :: start_file_type="earth" ! default start file type
+
+      if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then
+          write(lunout,*) trim(modname),' : Planeto-like start file'
+          start_file_type="planeto"
+      else
+          write(lunout,*) trim(modname),' : Earth-like start file'
+      endif 
+
       ierr = NF_OPEN(fichnom, NF_WRITE, nid)
       IF (ierr .NE. NF_NOERR) THEN
-         write(lunout,*)"dynredem1: Pb. d ouverture "//trim(fichnom)
+         PRINT*, "dynredem1: Pb. d ouverture "//trim(fichnom)
          CALL abort
       ENDIF
@@ -518,10 +637,19 @@
 
       nb = nb + 1
-      ierr = NF_INQ_VARID(nid, "temps", nvarid)
-      IF (ierr .NE. NF_NOERR) THEN
-         write(lunout,*) NF_STRERROR(ierr)
-         abort_message='Variable temps n est pas definie'
-         CALL abort_gcm(modname,abort_message,ierr)
-      ENDIF
+      if (start_file_type.eq."earth") then
+        ierr = NF_INQ_VARID(nid, "temps", nvarid)
+        IF (ierr .NE. NF_NOERR) THEN
+          write(lunout,*) NF_STRERROR(ierr)
+          abort_message='Variable temps n est pas definie'
+          CALL abort_gcm(modname,abort_message,ierr)
+        ENDIF
+      else
+        ierr = NF_INQ_VARID(nid,"Time", nvarid)
+        IF (ierr .NE. NF_NOERR) THEN
+          write(lunout,*) NF_STRERROR(ierr)
+          abort_message='Variable Time not found'
+          CALL abort_gcm(modname,abort_message,ierr)
+        ENDIF
+      endif ! of if (start_file_type.eq."earth") 
       call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/))
       write(lunout,*) "dynredem1: Enregistrement pour ", nb, time
@@ -537,5 +665,9 @@
       ENDIF
       ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl)
-       tab_cntrl(31) = REAL(itau_dyn + itaufin)
+      if (start_file_type=="earth") then
+        tab_cntrl(31) = REAL(itau_dyn + itaufin)
+      else
+        tab_cntrl(31) = 0
+      endif
       call NF95_PUT_VAR(nid,nvarid,tab_cntrl)
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F	(revision 892)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F	(revision 907)
@@ -10,5 +10,6 @@
       USE infotrac
       use netcdf95, only: NF95_PUT_VAR
- 
+      use control_mod, only : planet_type
+
       IMPLICIT NONE
 c=======================================================================
@@ -28,4 +29,5 @@
 #include "description.h"
 #include "serre.h"
+#include "iniprint.h"
 
 c   Arguments:
@@ -58,4 +60,6 @@
       character*30 unites
 
+      character(len=12) :: start_file_type="earth" ! default start file type
+      INTEGER idecal
 
 c-----------------------------------------------------------------------
@@ -73,4 +77,15 @@
       jjour0=1
 #endif        
+
+      !!! AS: idecal is a hack to be able to read planeto starts...
+      !!!     .... while keeping everything OK for LMDZ EARTH
+      if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then
+          write(lunout,*) trim(modname),' : Planeto-like start file'
+          start_file_type="planeto"
+          idecal = 4
+      else
+          write(lunout,*) trim(modname),' : Earth-like start file'
+          idecal = 5
+      endif
 
       DO l=1,length
@@ -80,49 +95,55 @@
        tab_cntrl(2)  = REAL(jjm)
        tab_cntrl(3)  = REAL(llm)
-       tab_cntrl(4)  = REAL(day_ref)
+       if (start_file_type.eq."earth") then
+         tab_cntrl(4)=REAL(day_ref)
+       else
+         tab_cntrl(4)=REAL(day_end)
+       endif
        tab_cntrl(5)  = REAL(annee_ref)
-       tab_cntrl(6)  = rad
-       tab_cntrl(7)  = omeg
-       tab_cntrl(8)  = g
-       tab_cntrl(9)  = cpp
-       tab_cntrl(10) = kappa
-       tab_cntrl(11) = daysec
-       tab_cntrl(12) = dtvr
-       tab_cntrl(13) = etot0
-       tab_cntrl(14) = ptot0
-       tab_cntrl(15) = ztot0
-       tab_cntrl(16) = stot0
-       tab_cntrl(17) = ang0
-       tab_cntrl(18) = pa
-       tab_cntrl(19) = preff
+       tab_cntrl(idecal+1)  = rad
+       tab_cntrl(idecal+2)  = omeg
+       tab_cntrl(idecal+3)  = g
+       tab_cntrl(idecal+4)  = cpp
+       tab_cntrl(idecal+5) = kappa
+       tab_cntrl(idecal+6) = daysec
+       tab_cntrl(idecal+7) = dtvr
+       tab_cntrl(idecal+8) = etot0
+       tab_cntrl(idecal+9) = ptot0
+       tab_cntrl(idecal+10) = ztot0
+       tab_cntrl(idecal+11) = stot0
+       tab_cntrl(idecal+12) = ang0
+       tab_cntrl(idecal+13) = pa
+       tab_cntrl(idecal+14) = preff
 c
 c    .....    parametres  pour le zoom      ......   
 
-       tab_cntrl(20)  = clon
-       tab_cntrl(21)  = clat
-       tab_cntrl(22)  = grossismx
-       tab_cntrl(23)  = grossismy
+       tab_cntrl(idecal+15)  = clon
+       tab_cntrl(idecal+16)  = clat
+       tab_cntrl(idecal+17)  = grossismx
+       tab_cntrl(idecal+18)  = grossismy
 c
       IF ( fxyhypb )   THEN
-       tab_cntrl(24) = 1.
-       tab_cntrl(25) = dzoomx
-       tab_cntrl(26) = dzoomy
-       tab_cntrl(27) = 0.
-       tab_cntrl(28) = taux
-       tab_cntrl(29) = tauy
+       tab_cntrl(idecal+19) = 1.
+       tab_cntrl(idecal+20) = dzoomx
+       tab_cntrl(idecal+21) = dzoomy
+       tab_cntrl(idecal+22) = 0.
+       tab_cntrl(idecal+23) = taux
+       tab_cntrl(idecal+24) = tauy
       ELSE
-       tab_cntrl(24) = 0.
-       tab_cntrl(25) = dzoomx
-       tab_cntrl(26) = dzoomy
-       tab_cntrl(27) = 0.
-       tab_cntrl(28) = 0.
-       tab_cntrl(29) = 0.
-       IF( ysinus )  tab_cntrl(27) = 1.
+       tab_cntrl(idecal+19) = 0.
+       tab_cntrl(idecal+20) = dzoomx
+       tab_cntrl(idecal+21) = dzoomy
+       tab_cntrl(idecal+22) = 0.
+       tab_cntrl(idecal+23) = 0.
+       tab_cntrl(idecal+24) = 0.
+       IF( ysinus )  tab_cntrl(idecal+22) = 1.
       ENDIF
 
-       tab_cntrl(30) = REAL(iday_end)
-       tab_cntrl(31) = REAL(itau_dyn + itaufin)
+      if (start_file_type.eq."earth") then
+       tab_cntrl(idecal+25) = REAL(iday_end)
+       tab_cntrl(idecal+26) = REAL(itau_dyn + itaufin)
 c start_time: start_time of simulation (not necessarily 0.)
-       tab_cntrl(32) = start_time
+       tab_cntrl(idecal+27) = start_time
+      endif
 c
 c    .........................................................
@@ -144,12 +165,23 @@
 c Definir les dimensions du fichiers:
 c
-      ierr = NF_DEF_DIM (nid, "index", length, idim_index)
-      ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
-      ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu)
-      ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv)
-      ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
-      ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s)
-      ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig)
-      ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim)
+      if (start_file_type.eq."earth") then
+        ierr = NF_DEF_DIM (nid, "index", length, idim_index)
+        ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
+        ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu)
+        ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv)
+        ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
+        ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s)
+        ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig)
+        ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim)
+      else
+        ierr = NF_DEF_DIM (nid, "index", length, idim_index)
+        ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
+        ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu)
+        ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv)
+        ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
+        ierr = NF_DEF_DIM (nid, "altitude", llm, idim_s)
+        ierr = NF_DEF_DIM (nid, "interlayer", llmp1, idim_sig)
+        ierr = NF_DEF_DIM (nid, "Time", NF_UNLIMITED, idim_tim)
+      endif
 c
       ierr = NF_ENDDEF(nid) ! sortir du mode de definition
@@ -222,29 +254,31 @@
       call NF95_PUT_VAR(nid,nvarid,rlatv)
 c
-      ierr = NF_REDEF (nid)
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid)
-#endif
-cIM 220306 END
-      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28,
+      if (start_file_type.eq."earth") then
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28,
      .                       "Numero naturel des couches s")
-      ierr = NF_ENDDEF(nid)
-      call NF95_PUT_VAR(nid,nvarid,nivsigs)
-c
-      ierr = NF_REDEF (nid)
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)
-#endif
-cIM 220306 END
-      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,nivsigs)
+c
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,
      .                       "Numero naturel des couches sigma")
-      ierr = NF_ENDDEF(nid)
-      call NF95_PUT_VAR(nid,nvarid,nivsig)
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,nivsig)
+      endif ! of if (start_file_type.eq."earth")
 c
       ierr = NF_REDEF (nid)
@@ -274,4 +308,32 @@
       call NF95_PUT_VAR(nid,nvarid,bp)
 c
+      if (start_file_type.ne."earth") then
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 37,
+     .                       "Coef AS: hybrid pressure at midlayers")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,aps)
+c
+        ierr = NF_REDEF (nid)
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_s,nvarid)
+#endif
+cIM 220306 END
+        ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 34,
+     .                       "Coef BS: hybrid sigma at midlayers")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,bps)
+      endif ! of if (start_file_type.ne."earth")
+c
       ierr = NF_REDEF (nid)
 cIM 220306 BEG
@@ -284,4 +346,44 @@
       ierr = NF_ENDDEF(nid)
       call NF95_PUT_VAR(nid,nvarid,presnivs)
+c
+      if (start_file_type.ne."earth") then
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid)
+#else
+        ierr = NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid)
+#endif
+        ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
+     .        "North latitude")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,rlatu*180/pi)
+c
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,idim_rlonv,nvarid)
+#else
+        ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,idim_rlonv,nvarid)
+#endif
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
+     .        "East longitude")
+        ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,rlonv*180/pi)
+c
+        ierr = NF_REDEF (nid)
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1,
+     .       idim_s,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1,
+     .       idim_s,nvarid)
+#endif
+        ierr = NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km")
+        ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up")
+        ierr = NF_ENDDEF(nid)
+        call NF95_PUT_VAR(nid,nvarid,pseudoalt)
+      endif ! of if (start_file_type.ne."earth")
 c
 c Coefficients de passage cov. <-> contra. <--> naturel
@@ -355,11 +457,19 @@
       ierr = NF_REDEF (nid) ! entrer dans le mode de definition
 c
-cIM 220306 BEG
-#ifdef NC_DOUBLE
-      ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid)
-#else
-      ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid)
-#endif
-cIM 220306 END
+      if (start_file_type.eq."earth") then
+cIM 220306 BEG
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid)
+#endif
+cIM 220306 END
+      else ! start_file_type=="planeto"
+#ifdef NC_DOUBLE
+        ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid)
+#else
+        ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid)
+#endif
+      endif ! of if (start_file_type.eq."earth")
       ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19,
      .                       "Temps de simulation")
@@ -465,12 +575,15 @@
       RETURN
       END
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
       SUBROUTINE dynredem1_p(fichnom,time,
      .                     vcov,ucov,teta,q,masse,ps)
       USE parallel
       USE infotrac
-      USE control_mod
+      USE control_mod, only : planet_type
       use netcdf, only: NF90_get_VAR
       use netcdf95, only: NF95_PUT_VAR
- 
+
       IMPLICIT NONE
 c=================================================================
@@ -484,5 +597,5 @@
 #include "comgeom.h"
 #include "temps.h"
-
+#include "iniprint.h"
 
       INTEGER l
@@ -501,5 +614,5 @@
       PARAMETER (length = 100)
       REAL tab_cntrl(length) ! tableau des parametres du run
-      character*20 modname
+      character(len=*),parameter :: modname='dynredem1'
       character*80 abort_message
 c
@@ -509,4 +622,12 @@
 
       logical exist_file
+      character(len=12) :: start_file_type="earth" ! default start file type
+
+      if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then
+          write(lunout,*) trim(modname),' : Planeto-like start file'
+          start_file_type="planeto"
+      else
+          write(lunout,*) trim(modname),' : Earth-like start file'
+      endif 
 
       call Gather_Field(ucov,ip1jmp1,llm,0)
@@ -523,8 +644,7 @@
       if (mpi_rank==0) then
       
-      modname = 'dynredem1'
       ierr = NF_OPEN(fichnom, NF_WRITE, nid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "Pb. d ouverture "//fichnom
+         PRINT*, "dynredem1: Pb. d ouverture "//trim(fichnom)
          CALL abort
       ENDIF
@@ -533,10 +653,19 @@
 
       nb = nb + 1
-      ierr = NF_INQ_VARID(nid, "temps", nvarid)
-      IF (ierr .NE. NF_NOERR) THEN
-         print *, NF_STRERROR(ierr)
-         abort_message='Variable temps n est pas definie'
-         CALL abort_gcm(modname,abort_message,ierr)
-      ENDIF
+      if (start_file_type.eq."earth") then
+        ierr = NF_INQ_VARID(nid, "temps", nvarid)
+        IF (ierr .NE. NF_NOERR) THEN
+          write(lunout,*) NF_STRERROR(ierr)
+          abort_message='Variable temps n est pas definie'
+          CALL abort_gcm(modname,abort_message,ierr)
+        ENDIF
+      else
+        ierr = NF_INQ_VARID(nid,"Time", nvarid)
+        IF (ierr .NE. NF_NOERR) THEN
+          write(lunout,*) NF_STRERROR(ierr)
+          abort_message='Variable Time not found'
+          CALL abort_gcm(modname,abort_message,ierr)
+        ENDIF
+      endif ! of if (start_file_type.eq."earth") 
       call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/))
       PRINT*, "Enregistrement pour ", nb, time
@@ -552,5 +681,9 @@
       ENDIF
       ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl)
-       tab_cntrl(31) = REAL(itau_dyn + itaufin)
+      if (start_file_type=="earth") then
+        tab_cntrl(31) = REAL(itau_dyn + itaufin)
+      else
+        tab_cntrl(31) = 0
+      endif
       call NF95_PUT_VAR(nid,nvarid,tab_cntrl)
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F	(revision 892)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F	(revision 907)
@@ -145,4 +145,6 @@
          write(lunout,*) " lon = ",rlonv(i)*180./pi, " deg",
      &                   " lat = ",rlatu(j)*180./pi, " deg"
+         write(lunout,*) " psm1(ij)=",psm1(stop_it)," dt=",dt,
+     &                   " dp(ij)=",dp(stop_it)
         ENDIF
 
