c  ID
c  Program types out the header of a standard grid file.
      character*80 infile,prjnam
      dimension id(14),pgm(2),cmbl(2)
      call askin
      infile=' '
10    call askc('Enter input file name',infile,ierr)
      if(ierr.eq.-2) stop
      call gopen(10,infile,'old','read',ierr)
      if(ierr.ne.0) go to 99
      call gheader('r',10,id,ncol,nrow,x0,dx,y0,dy,ierr)
      if(ierr.ne.0) go to 99
c  get the old creation program name
      call gpgm(pgm)
c  get the projection name
      call mpsnam('read',1,prjnam,nchp,ierr)
33    write(6,3)(id(i),i=1,14),(pgm(i),i=1,2)
3     format(1x,'title: ',14a4,/1x,'created by: ',2a4)
      if(ierr.eq.0) then
        write(6,803) prjnam(1:nchp)
803     format(' projection: ',a)
        if(prjnam.ne.'not specified') then
c  get the projection parameters
          call mpsref('read',1,cmbl,n,ierr)
          write(6,804) cmbl(1),cmbl(2)
804   format(' central merid. = ',f11.6,' base lat. = ',g11.6)
        endif
      else
        print*,'unrecognized projection'
      endif
      write(6,4)ncol,nrow
4     format(1x,'ncol =',0pi5,5x,'nrow =',i5)
      write(6,5)x0,dx,y0,dy
5     format(1x,'x0 =',g14.7,2x,'dx =',g14.7,3x,'y0 =',g14.7,2x,'dy =',
     &g14.7)
      call gclose(10,'keep')
      go to 300
99    print *,'Error opening file or reading header.  Try again.'
      go to 10
300   continue
      end
