!=============================================================================
!
      subroutine getdata(fname,pres,hgt,u,v,mr,sfcgrid,nxin,nyin,nzin)
!
! *** Read input upper air data.
!
!
      implicit none
      integer:: nxin,nyin,nzin ,dum1,dum2,dum3
      integer::i,j,k,l
!
! *** Output data variables.
!
      real,dimension(nxin,nyin,nzin)::u,v,hgt,mr 
      real,dimension(nxin,nyin,14):: sfcgrid
      REAL ,DIMENSION(nzin):: pres          
      character(len=*)::fname
!
! *** Open data file.
!
      open(1,file=fname,status='old',form='unformatted')
      read(1) dum1
      read(1) (((u(i,j,k),i=1,nxin),j=1,nyin),k=nzin,1,-1)
      read(1) (((v(i,j,k),i=1,nxin),j=1,nyin),k=nzin,1,-1)
      read(1) (((hgt(i,j,k),i=1,nxin),j=1,nyin),k=nzin,1,-1)
      read(1) (((mr(i,j,k),i=1,nxin),j=1,nyin),k=nzin,1,-1)
      read(1) (pres(k),k=nzin,1,-1)
      read(1) sfcgrid
      close(1)

      do l=1,nzin
        print *,l,pres(l)
      enddo
      pres=pres*100.
						
      return
      END SUBROUTINE getdata

