Index: dynamico_lmdz/simple_physics/config/LMDZ/build_lmdz_phyparam.sh
===================================================================
--- dynamico_lmdz/simple_physics/config/LMDZ/build_lmdz_phyparam.sh	(revision 4180)
+++ dynamico_lmdz/simple_physics/config/LMDZ/build_lmdz_phyparam.sh	(revision 4181)
@@ -26,4 +26,5 @@
     ln -s ../phydev/* .
     ln -sf $ROOT/phyparam/param/* .
+    ln -sf $ROOT/phyparam/physics/* .
     cd ../dynphy_lonlat/phyparam
     ln -s ../phydev/* .
Index: dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd.h
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd.h	(revision 4181)
+++ dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd.h	(revision 4181)
@@ -0,0 +1,16 @@
+!=======================================================================
+!
+!   Auteur:  F. Hourdin
+!   -------
+!
+!   Objet:
+!   ------
+!   Light interface for netcdf outputs. can be used outside LMDZ
+!
+!=======================================================================
+
+      integer imax,jmax,lmax,nid
+      INTEGER dim_coord(4)
+      real iotd_ts
+
+      common/ecritd_c/imax,jmax,lmax,nid,dim_coord,iotd_ts
Index: dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ecrit.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ecrit.F90	(revision 4181)
+++ dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ecrit.F90	(revision 4181)
@@ -0,0 +1,180 @@
+      subroutine iotd_ecrit(nom,llm,titre,unite,px)
+
+
+!=======================================================================
+!
+!   Auteur:  F. Hourdin
+!   -------
+!
+!   Objet:
+!   ------
+!   Light interface for netcdf outputs. can be used outside LMDZ
+!
+!=======================================================================
+!-----------------------------------------------------------------------
+!  ----------
+!      nom  : nom de la variable a sortir (chaine de caracteres)
+!      llm  : nombre de couches
+!      titre: titre de la variable (chaine de caracteres)
+!      unite : unite de la variable (chaine de caracteres)
+!      px : variable a sortir
+!
+!=================================================================
+ 
+      implicit none
+
+! Commons
+
+#include "netcdf.inc"
+#include "iotd.h"
+
+
+! Arguments on input:
+      integer llm
+      character (len=*) :: nom,titre,unite
+      integer imjmax
+      parameter (imjmax=100000)
+      real px(imjmax*llm)
+
+! Local variables:
+
+      real*4 date
+      real*4 zx(imjmax*llm)
+
+
+      integer ierr,ndim,dim_cc(4)
+      integer iq
+      integer i,j,l
+
+      integer zitau
+      character firstnom*20
+      SAVE firstnom
+      SAVE zitau
+      SAVE date
+      data firstnom /'1234567890'/
+      data zitau /0/
+
+! Ajouts
+      integer, save :: ntime=0
+      integer :: idim,varid
+      character (len =50):: fichnom
+      integer, dimension(4) :: id
+      integer, dimension(4) :: edges,corner
+      
+
+!***************************************************************
+! Initialisation of 'firstnom' and create/open the "diagfi.nc" NetCDF file
+! ------------------------------------------------------------------------
+! (Au tout premier appel de la subroutine durant le run.)
+
+
+!--------------------------------------------------------
+! Write the variables to output file if it's time to do so
+!--------------------------------------------------------
+
+
+! Compute/write/extend 'Time' coordinate (date given in days)
+! (done every "first call" (at given time level) to writediagfi)
+! Note: date is incremented as 1 step ahead of physics time
+!--------------------------------------------------------
+
+        zx(1:imax*jmax*llm)=px(1:imax*jmax*llm)
+        if (firstnom =='1234567890') then
+            firstnom=nom
+        endif
+
+!      print*,'nom ',nom,firstnom
+
+!! Quand on tombe sur la premiere variable on ajoute un pas de temps
+        if (nom.eq.firstnom) then
+        ! We have identified a "first call" (at given date)
+
+           ntime=ntime+1 ! increment # of stored time steps
+
+!!          print*,'ntime ',ntime
+           date=ntime
+!          date= float (zitau +1)/float (day_step)
+
+           ! compute corresponding date (in days and fractions thereof)
+           ! Get NetCDF ID of 'Time' variable
+
+           ierr=NF_SYNC(nid)
+
+           ierr= NF_INQ_VARID(nid,"Time",varid)
+           ! Write (append) the new date to the 'Time' array
+
+
+           ierr= NF_PUT_VARA_REAL(nid,varid,ntime,1,date)
+
+!          print*,'date ',date,ierr,nid
+!        print*,'IOTD Date ,varid,nid,ntime,date',varid,nid,ntime,date
+
+           if (ierr.ne.NF_NOERR) then
+              write(*,*) "***** PUT_VAR matter in writediagfi_nc"
+              write(*,*) "***** with time"
+              write(*,*) 'ierr=', ierr   
+           endif
+
+!          write(6,*)'WRITEDIAGFI: date= ', date
+        end if ! of if (nom.eq.firstnom)
+
+
+!Case of a 3D variable
+!---------------------
+        if (llm==lmax) then
+           ndim=4
+           corner(1)=1
+           corner(2)=1
+           corner(3)=1
+           corner(4)=ntime
+           edges(1)=imax
+           edges(2)=jmax
+           edges(3)=llm
+           edges(4)=1
+           dim_cc=dim_coord
+
+
+!Case of a 2D variable
+!---------------------
+
+        else if (llm==1) then
+           ndim=3
+           corner(1)=1
+           corner(2)=1
+           corner(3)=ntime
+           corner(4)=1
+           edges(1)=imax
+           edges(2)=jmax
+           edges(3)=1
+           edges(4)=1
+           dim_cc(1:2)=dim_coord(1:2)
+           dim_cc(3)=dim_coord(4)
+
+        endif ! of if llm=1 ou llm
+
+! AU premier pas de temps, on crée les variables
+!-----------------------------------------------
+
+      if (ntime==1) then
+          ierr = NF_REDEF (nid)
+          ierr = NF_DEF_VAR(nid,nom,NF_FLOAT,ndim,dim_cc,varid)
+          print*,'DEF ',nom,nid,varid
+          ierr = NF_ENDDEF(nid)
+      else
+         ierr= NF_INQ_VARID(nid,nom,varid)
+          print*,'INQ ',nom,nid,varid
+! Commandes pour recuperer automatiquement les coordonnees
+!             ierr= NF_INQ_DIMID(nid,"longitude",id(1))
+      endif
+
+
+      ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,zx)
+
+      if (ierr.ne.NF_NOERR) then
+           write(*,*) "***** PUT_VAR problem in writediagfi"
+           write(*,*) "***** with ",nom
+           write(*,*) 'ierr=', ierr
+      endif 
+
+
+      end
Index: dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_fin.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_fin.F90	(revision 4181)
+++ dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_fin.F90	(revision 4181)
@@ -0,0 +1,25 @@
+      SUBROUTINE iotd_fin
+      IMPLICIT NONE
+
+!=======================================================================
+!
+!   Auteur:  F. Hourdin
+!   -------
+!
+!   Objet:
+!   ------
+!   Light interface for netcdf outputs. can be used outside LMDZ
+!
+!=======================================================================
+
+
+#include "netcdf.inc"
+#include "iotd.h"
+      integer ierr
+
+!   Arguments:
+!   ----------
+
+      ierr=NF_close(nid)
+
+      END
Index: dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ini.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ini.F90	(revision 4181)
+++ dynamico_lmdz/simple_physics/phyparam/dynphy_lonlat/iotd_ini.F90	(revision 4181)
@@ -0,0 +1,116 @@
+      SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlonv,prlatu,pcoordv)
+      IMPLICIT NONE
+
+!=======================================================================
+!
+!   Auteur:  F. Hourdin
+!   -------
+!
+!   Objet:
+!   ------
+!   Light interface for netcdf outputs. can be used outside LMDZ
+!
+!=======================================================================
+!-----------------------------------------------------------------------
+!   Declarations:
+!   -------------
+
+#include "netcdf.inc"
+#include "iotd.h"
+
+!   Arguments:
+!   ----------
+
+      integer iim,jjm,llm
+      real prlonv(iim),prlatu(jjm),pcoordv(llm),timestep
+      INTEGER id_FOCE
+
+      integer corner(4),edges(4),ndim
+      real  px(1000)
+      character (len=10) :: nom
+
+!   Local:
+!   ------
+      INTEGER ierr
+
+      integer :: nvarid
+      integer, dimension(2) :: id  
+      integer :: varid
+
+      character*10 fichnom
+      real*4 rlonv(iim),rlatu(jjm),coordv(llm)
+
+      real pi
+
+      print*,'INIIO prlonv ',prlonv
+      imax=iim
+      jmax=jjm
+      lmax=llm
+
+      rlonv=prlonv
+      rlatu=prlatu
+      coordv=pcoordv
+
+!-----------------------------------------------------------------------
+
+
+      pi=2.*asin(1.)
+
+! Define dimensions
+    
+         ! Create the NetCDF file
+         ierr=NF_CREATE(fichnom, NF_CLOBBER, nid)
+         ! Define the 'Time' dimension
+         ierr=nf_def_dim(nid,"Time",NF_UNLIMITED,dim_coord(4))
+         ! Define the 'Time' variable
+         ierr=NF_DEF_VAR(nid, "Time", NF_FLOAT, 1, dim_coord(4),varid)
+!        ! Add a long_name attribute
+!        ierr=NF_PUT_ATT_TEXT(nid, varid, "long_name",4,"Time")
+!        ! Add a units attribute
+         ierr=NF_PUT_ATT_TEXT(nid, varid,'units',29,"days since 0000-00-0 00:00:00")
+         ! Switch out of NetCDF Define mode
+
+      ierr=NF_DEF_DIM(nid, "longitude", iim, dim_coord(1))
+      ierr=NF_DEF_DIM(nid, "latitude", jjm, dim_coord(2))
+      ierr=NF_DEF_DIM(nid, "altitude", llm, dim_coord(3))
+
+
+      ierr=NF_ENDDEF(nid)
+!
+!  Contol parameters for this run
+! --------------------------
+
+      ierr=NF_REDEF(nid)
+      ierr=NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, dim_coord(1),nvarid)
+!     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)
+      ierr=NF_PUT_VAR_REAL(nid,nvarid,rlonv)
+       print*,ierr
+
+! --------------------------
+      ierr=NF_REDEF(nid)
+      ierr=NF_DEF_VAR(nid, "latitude", NF_FLOAT, 1, dim_coord(2),nvarid)
+!     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)
+      ierr=NF_PUT_VAR_REAL(nid,nvarid,rlatu)
+!
+! --------------------------
+      ierr=NF_REDEF(nid)
+      ierr=NF_DEF_VAR(nid, "altitude", NF_FLOAT, 1,dim_coord(3),nvarid)
+      ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
+!     ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',2,"km")
+      if ( pcoordv(2)>pcoordv(1) ) then
+         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
+         ierr=NF_PUT_ATT_TEXT(nid,nvarid,'positive',2,"up")
+      else
+         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",8,"pressure")
+         ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',4,"down")
+      endif
+      ierr=NF_ENDDEF(nid)
+
+      ierr=NF_PUT_VAR_REAL(nid,nvarid,coordv)
+!
+      END
Index: dynamico_lmdz/simple_physics/phyparam/param/ftn00
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/param/ftn00	(revision 4180)
+++ 	(revision )
@@ -1,2 +1,0 @@
- DRS error   22 in routine aslun   
- Cannot open dictionary file.                                                    
Index: dynamico_lmdz/simple_physics/phyparam/param/iotd.h
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/param/iotd.h	(revision 4180)
+++ 	(revision )
@@ -1,16 +1,0 @@
-!=======================================================================
-!
-!   Auteur:  F. Hourdin
-!   -------
-!
-!   Objet:
-!   ------
-!   Light interface for netcdf outputs. can be used outside LMDZ
-!
-!=======================================================================
-
-      integer imax,jmax,lmax,nid
-      INTEGER dim_coord(4)
-      real iotd_ts
-
-      common/ecritd_c/imax,jmax,lmax,nid,dim_coord,iotd_ts
Index: dynamico_lmdz/simple_physics/phyparam/param/iotd_ecrit.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/param/iotd_ecrit.F90	(revision 4180)
+++ 	(revision )
@@ -1,180 +1,0 @@
-      subroutine iotd_ecrit(nom,llm,titre,unite,px)
-
-
-!=======================================================================
-!
-!   Auteur:  F. Hourdin
-!   -------
-!
-!   Objet:
-!   ------
-!   Light interface for netcdf outputs. can be used outside LMDZ
-!
-!=======================================================================
-!-----------------------------------------------------------------------
-!  ----------
-!      nom  : nom de la variable a sortir (chaine de caracteres)
-!      llm  : nombre de couches
-!      titre: titre de la variable (chaine de caracteres)
-!      unite : unite de la variable (chaine de caracteres)
-!      px : variable a sortir
-!
-!=================================================================
- 
-      implicit none
-
-! Commons
-
-#include "netcdf.inc"
-#include "iotd.h"
-
-
-! Arguments on input:
-      integer llm
-      character (len=*) :: nom,titre,unite
-      integer imjmax
-      parameter (imjmax=100000)
-      real px(imjmax*llm)
-
-! Local variables:
-
-      real*4 date
-      real*4 zx(imjmax*llm)
-
-
-      integer ierr,ndim,dim_cc(4)
-      integer iq
-      integer i,j,l
-
-      integer zitau
-      character firstnom*20
-      SAVE firstnom
-      SAVE zitau
-      SAVE date
-      data firstnom /'1234567890'/
-      data zitau /0/
-
-! Ajouts
-      integer, save :: ntime=0
-      integer :: idim,varid
-      character (len =50):: fichnom
-      integer, dimension(4) :: id
-      integer, dimension(4) :: edges,corner
-      
-
-!***************************************************************
-! Initialisation of 'firstnom' and create/open the "diagfi.nc" NetCDF file
-! ------------------------------------------------------------------------
-! (Au tout premier appel de la subroutine durant le run.)
-
-
-!--------------------------------------------------------
-! Write the variables to output file if it's time to do so
-!--------------------------------------------------------
-
-
-! Compute/write/extend 'Time' coordinate (date given in days)
-! (done every "first call" (at given time level) to writediagfi)
-! Note: date is incremented as 1 step ahead of physics time
-!--------------------------------------------------------
-
-        zx(1:imax*jmax*llm)=px(1:imax*jmax*llm)
-        if (firstnom =='1234567890') then
-            firstnom=nom
-        endif
-
-!      print*,'nom ',nom,firstnom
-
-!! Quand on tombe sur la premiere variable on ajoute un pas de temps
-        if (nom.eq.firstnom) then
-        ! We have identified a "first call" (at given date)
-
-           ntime=ntime+1 ! increment # of stored time steps
-
-!!          print*,'ntime ',ntime
-           date=ntime
-!          date= float (zitau +1)/float (day_step)
-
-           ! compute corresponding date (in days and fractions thereof)
-           ! Get NetCDF ID of 'Time' variable
-
-           ierr=NF_SYNC(nid)
-
-           ierr= NF_INQ_VARID(nid,"Time",varid)
-           ! Write (append) the new date to the 'Time' array
-
-
-           ierr= NF_PUT_VARA_REAL(nid,varid,ntime,1,date)
-
-!          print*,'date ',date,ierr,nid
-!        print*,'IOTD Date ,varid,nid,ntime,date',varid,nid,ntime,date
-
-           if (ierr.ne.NF_NOERR) then
-              write(*,*) "***** PUT_VAR matter in writediagfi_nc"
-              write(*,*) "***** with time"
-              write(*,*) 'ierr=', ierr   
-           endif
-
-!          write(6,*)'WRITEDIAGFI: date= ', date
-        end if ! of if (nom.eq.firstnom)
-
-
-!Case of a 3D variable
-!---------------------
-        if (llm==lmax) then
-           ndim=4
-           corner(1)=1
-           corner(2)=1
-           corner(3)=1
-           corner(4)=ntime
-           edges(1)=imax
-           edges(2)=jmax
-           edges(3)=llm
-           edges(4)=1
-           dim_cc=dim_coord
-
-
-!Case of a 2D variable
-!---------------------
-
-        else if (llm==1) then
-           ndim=3
-           corner(1)=1
-           corner(2)=1
-           corner(3)=ntime
-           corner(4)=1
-           edges(1)=imax
-           edges(2)=jmax
-           edges(3)=1
-           edges(4)=1
-           dim_cc(1:2)=dim_coord(1:2)
-           dim_cc(3)=dim_coord(4)
-
-        endif ! of if llm=1 ou llm
-
-! AU premier pas de temps, on crée les variables
-!-----------------------------------------------
-
-      if (ntime==1) then
-          ierr = NF_REDEF (nid)
-          ierr = NF_DEF_VAR(nid,nom,NF_FLOAT,ndim,dim_cc,varid)
-          print*,'DEF ',nom,nid,varid
-          ierr = NF_ENDDEF(nid)
-      else
-         ierr= NF_INQ_VARID(nid,nom,varid)
-          print*,'INQ ',nom,nid,varid
-! Commandes pour recuperer automatiquement les coordonnees
-!             ierr= NF_INQ_DIMID(nid,"longitude",id(1))
-      endif
-
-
-      ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,zx)
-
-      if (ierr.ne.NF_NOERR) then
-           write(*,*) "***** PUT_VAR problem in writediagfi"
-           write(*,*) "***** with ",nom
-           write(*,*) 'ierr=', ierr
-      endif 
-
-
-      end
Index: dynamico_lmdz/simple_physics/phyparam/param/iotd_fin.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/param/iotd_fin.F90	(revision 4180)
+++ 	(revision )
@@ -1,25 +1,0 @@
-      SUBROUTINE iotd_fin
-      IMPLICIT NONE
-
-!=======================================================================
-!
-!   Auteur:  F. Hourdin
-!   -------
-!
-!   Objet:
-!   ------
-!   Light interface for netcdf outputs. can be used outside LMDZ
-!
-!=======================================================================
-
-
-#include "netcdf.inc"
-#include "iotd.h"
-      integer ierr
-
-!   Arguments:
-!   ----------
-
-      ierr=NF_close(nid)
-
-      END
Index: dynamico_lmdz/simple_physics/phyparam/param/iotd_ini.F90
===================================================================
--- dynamico_lmdz/simple_physics/phyparam/param/iotd_ini.F90	(revision 4180)
+++ 	(revision )
@@ -1,116 +1,0 @@
-      SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlonv,prlatu,pcoordv)
-      IMPLICIT NONE
-
-!=======================================================================
-!
-!   Auteur:  F. Hourdin
-!   -------
-!
-!   Objet:
-!   ------
-!   Light interface for netcdf outputs. can be used outside LMDZ
-!
-!=======================================================================
-!-----------------------------------------------------------------------
-!   Declarations:
-!   -------------
-
-#include "netcdf.inc"
-#include "iotd.h"
-
-!   Arguments:
-!   ----------
-
-      integer iim,jjm,llm
-      real prlonv(iim),prlatu(jjm),pcoordv(llm),timestep
-      INTEGER id_FOCE
-
-      integer corner(4),edges(4),ndim
-      real  px(1000)
-      character (len=10) :: nom
-
-!   Local:
-!   ------
-      INTEGER ierr
-
-      integer :: nvarid
-      integer, dimension(2) :: id  
-      integer :: varid
-
-      character*10 fichnom
-      real*4 rlonv(iim),rlatu(jjm),coordv(llm)
-
-      real pi
-
-      print*,'INIIO prlonv ',prlonv
-      imax=iim
-      jmax=jjm
-      lmax=llm
-
-      rlonv=prlonv
-      rlatu=prlatu
-      coordv=pcoordv
-
-!-----------------------------------------------------------------------
-
-
-      pi=2.*asin(1.)
-
-! Define dimensions
-    
-         ! Create the NetCDF file
-         ierr=NF_CREATE(fichnom, NF_CLOBBER, nid)
-         ! Define the 'Time' dimension
-         ierr=nf_def_dim(nid,"Time",NF_UNLIMITED,dim_coord(4))
-         ! Define the 'Time' variable
-         ierr=NF_DEF_VAR(nid, "Time", NF_FLOAT, 1, dim_coord(4),varid)
-!        ! Add a long_name attribute
-!        ierr=NF_PUT_ATT_TEXT(nid, varid, "long_name",4,"Time")
-!        ! Add a units attribute
-         ierr=NF_PUT_ATT_TEXT(nid, varid,'units',29,"days since 0000-00-0 00:00:00")
-         ! Switch out of NetCDF Define mode
-
-      ierr=NF_DEF_DIM(nid, "longitude", iim, dim_coord(1))
-      ierr=NF_DEF_DIM(nid, "latitude", jjm, dim_coord(2))
-      ierr=NF_DEF_DIM(nid, "altitude", llm, dim_coord(3))
-
-
-      ierr=NF_ENDDEF(nid)
-!
-!  Contol parameters for this run
-! --------------------------
-
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, dim_coord(1),nvarid)
-!     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)
-      ierr=NF_PUT_VAR_REAL(nid,nvarid,rlonv)
-       print*,ierr
-
-! --------------------------
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid, "latitude", NF_FLOAT, 1, dim_coord(2),nvarid)
-!     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)
-      ierr=NF_PUT_VAR_REAL(nid,nvarid,rlatu)
-!
-! --------------------------
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid, "altitude", NF_FLOAT, 1,dim_coord(3),nvarid)
-      ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
-!     ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',2,"km")
-      if ( pcoordv(2)>pcoordv(1) ) then
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,'positive',2,"up")
-      else
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",8,"pressure")
-         ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',4,"down")
-      endif
-      ierr=NF_ENDDEF(nid)
-
-      ierr=NF_PUT_VAR_REAL(nid,nvarid,coordv)
-!
-      END
