       program testpres0

c      A very simple example of a call to subroutine  pres0

       implicit none

       character*9 dset       ! path to MCD data directory
       data dset/'MCD_DATA/'/ ! default path to MCD datafiles
                              ! edit it to fit your settings; don't forget
                              ! to add a the trailing '/' and to set the
                              ! exact length of dset (in the character*? dset
                              ! declaration above)
       real Ls        ! solar longitude, in degrees
       real lat       ! latitude (degrees)
       real lon       ! longitude east (degrees)
       real localtime ! local time at longitude lon, in martian hours 
       real ps        ! surface pressure
       real alt       ! topography: i.e. (above areoid) altitude of surface
       integer ierr   ! pres0 returned status code (=0 if OK)


! In this example, we seek the orography and surface pressure at the place
! and time of the Mars Exploration Rover 'Spirit' landing.
       lat=-14.57
       lon=175.48
       Ls=327.7
       localtime=14.417

! Now that dset,lat,lon,Ls and localtime are set, call pres0
       call pres0(dset,lat,lon,Ls,localtime,ps,alt,ierr)

! Print the result to output, if all went well       
       if (ierr.eq.0) then
         write(*,'(A25,F8.2)') ' MOLA altitude (m) =', alt
         write(*,'(A25,F8.2)') ' Surface pressure (Pa) =', ps
       endif
       
! For the 'Spirit' example, you should get the following output:
! MOLA altitude (m) =    -1940.55
! Surface pressure (Pa) = 655.34

       end
