Index: LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 4109)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 4110)
@@ -1033,5 +1033,7 @@
 !
 !=====================================================================
+#ifdef OUTPUT_PHYS_SCM
        CALL iophys_ini(timestep)
+#endif
 ! START OF THE TEMPORAL LOOP :
 !=====================================================================
@@ -1286,7 +1288,8 @@
      &             +dt_cooling(1:mxcalc))  ! Taux de chauffage ou refroid.
 
-print*,'OLDLMDZ1D IOPH'
+#ifdef OUTPUT_PHYS_SCM
       CALL iophys_ecrit('d_t_adv',klev,'d_t_adv','m/s',d_t_adv)
       CALL iophys_ecrit('d_t_nudge',klev,'d_t_nudge','m/s',d_t_nudge)
+#endif
 
       endif  ! forcing_sandu or forcing_astex
Index: LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.F90	(revision 4109)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.F90	(revision 4110)
@@ -3,4 +3,7 @@
   USE mod_const_mpi, ONLY: comm_lmdz
   USE inigeomphy_mod, ONLY: inigeomphy
+ USE comvert_mod, ONLY: presnivs
+USE comvert_mod, only :  preff, pa
+
 
 
@@ -8,5 +11,4 @@
 #include "dimensions.h"
 
-real presnivs(llm)
 real :: airefi
 real :: zcufi    = 1.
@@ -27,4 +29,8 @@
   rlat_rad(1)=0.
   rlon_rad(1)=0.
+
+preff=101325.
+pa=50000.
+  CALL disvert()
   CALL inigeomphy(1,1,llm, &
                1, comm_lmdz, &
@@ -36,14 +42,5 @@
 
 CALL suphel
-
-!---------------------------------------------------------------------
-! Initialisation d'un fichier de sorties
-!---------------------------------------------------------------------
-call system("ncdump -h phys.nc  |grep -i time | head -1 | cut -d\( -f2  | awk ' { print $1 } ' > presnivs")
-call system("ncks -v lev phys.nc | grep 'lev.*.,' | sed -e 's/lev//' -e 's/[=;,]//g' >> presnivs")
-open(10,file="presnivs",form="formatted")
-read(10,*) ntime
-read(10,*) presnivs
-close(10)
+ntime=100
 jour0=1
 mois0=1
@@ -51,5 +48,5 @@
 klon=1
 klev=llm
-call iotd_ini('physb.nc',1,1,klev,0.,0.,presnivs,jour0,mois0,an0,0.,900.,'360d')
+call iotd_ini('phys.nc',1,1,klev,0.,0.,presnivs,jour0,mois0,an0,0.,900.,'360d')
 
 !---------------------------------------------------------------------
Index: LMDZ6/trunk/libf/phylmd/iophys.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/iophys.F90	(revision 4109)
+++ LMDZ6/trunk/libf/phylmd/iophys.F90	(revision 4110)
@@ -207,2 +207,56 @@
 
 #endif
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! Interface pour ecrire en netcdf avec les routines d'enseignement
+! iotd de Frederic Hourdin
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      SUBROUTINE iotd_ecrit_seq(nom,lllm,titre,unite,px)
+
+      IMPLICIT NONE
+
+! px arrive 
+
+#include "iotd.h"
+
+
+! Arguments on input:
+      integer lllm
+      character (len=*) :: nom,titre,unite
+      integer imjmax
+      parameter (imjmax=100000)
+      real px(imjmax*lllm)
+      real, allocatable :: zx(:,:,:)
+      integer i,j,l,ijl
+
+      allocate(zx(imax,jmax,lllm))
+
+      ijl=0
+      do l=1,lllm
+         ! Pole nord
+         ijl=ijl+1
+         do i=1,imax
+            zx(i,1,l)=px(ijl)
+         enddo
+         ! Grille normale
+         do j=2,jmax-1
+            do i=1,imax
+               ijl=ijl+1
+               zx(i,j,l)=px(ijl)
+            enddo
+         enddo
+         ! Pole sud
+         if ( jmax > 1 ) then
+            ijl=ijl+1
+            do i=1,imax
+               zx(i,jmax,l)=px(ijl)
+            enddo
+         endif
+      enddo
+
+      call iotd_ecrit(nom,lllm,titre,unite,zx)
+      deallocate(zx)
+
+      return
+      end
+
