      SUBROUTINE MAIN0
C
C vis5d program for managing and analyzing 3D gridded data sets
C Copyright (C) 1990  Bill Hibbard, Dave Santek and Brian Paul
C
C This program is free software; you can redistribute it and/or modify
C it under the terms of the GNU General Public License as published by
C the Free Software Foundation; either version 1, or (at your option)
C any later version.
C
C This program is distributed in the hope that it will be useful,
C but WITHOUT ANY WARRANTY; without even the implied warranty of
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
C GNU General Public License for more details.
C
C You should have received a copy of the GNU General Public License
C along with this program; if not, write to the Free Software
C Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
C
C
C ? NAME
C ?    get3d - extract a single grid from a grid file
C ?
C ? SYNOPSIS
C ?    get3d gr3df gr3dnum
C ?
C ? DESCRIPTION
C ?    Extract grid number 'gr3dnum' from grid file 'gr3df'.
C ?
C ? EXAMPLE
C ?    get3d 2 12
C ?       Extract grid number 12 from grid file GR3D0002.
C
C
      IMPLICIT INTEGER (A,B,E-Z)
      IMPLICIT CHARACTER*12 (C)
      IMPLICIT REAL*8 (D)
      CHARACTER*4 CLIT
      REAL*4 DUSPD,DVSPD,DIFA,DIFB,DA,DB
      PARAMETER (MAXWDS=200000,MXGRDS=6)
      CHARACTER*3 COPT
      CHARACTER*8 FILNAM
      REAL*4 XVAL,GA(MAXWDS),GB(MAXWDS),GC(MAXWDS),XNULL,XTEST
      REAL*4 GG(MAXWDS,MXGRDS)
      COMMON/GRIDXX/GA,GB,GC
      INTEGER TABLE(64),TABLE2(64)
      INTEGER IGG(MXGRDS)
      DATA HEDSIZ/64/,XTEST/1.E30/,XNULL/1.E40/
      DATA ENDMRK/'80808080'X/
C
      IGF=IPP(1,0)
      IGRID=IPP(2,0)
      CALL SCOUT('IGF',IGF,IGRID,0,0,0,0)
      ISTAT = IGGT3D(IGF,IGRID,MAXWDS,GA,NR,NC,NL,TABLE)
      IF (ISTAT.NE.0) GO TO 99
C
C GRID IN GA
      WRITE (6,30) (GA(I),I=1,NR*NC*NL)
30    FORMAT(1X,12F9.3)
      RETURN
C
C
 99   CONTINUE
      CALL SDEST(' BAD GRID READ ',ISTAT)
      RETURN
      END
