C*********************************************************************
C*********************************************************************
C
      SUBROUTINE VBASIC
     I   ( ZGRID, PSFC,
     O     PRES0, DENS0, TEMP0, TPOT0, PPAI0,
     O     QVAP0, RVAP0,
     C     GRAV , RDRY , CPDRY, PSD,  RMVAP,
     D     NZ, NZB                              )
C
C*********************************************************************
      IMPLICIT REAL*8 ( A-H, O-Z )
C*********************************************************************
C
C
C
      DIMENSION
     \   PRES0(-2:NZB), TEMP0(-2:NZB), TPOT0(-2:NZB),
     \   PPAI0(-2:NZB), DENS0(-2:NZB), ZGRID(-2:NZB),
     \   RVAP0(-2:NZB), QVAP0(-2:NZB)
C
C====================================================================
C

      OPEN(11,FILE='1D.DATA')

      do IZ = -2, NZB
         READ(11,*) ITW, ZGRID(IZ), PRES0(IZ), DENS0(IZ),
     \                  TEMP0(IZ), TPOT0(IZ), PPAI0(IZ), 
     \                  QVAP0(IZ), RVAP0(IZ)
      end do

      CLOSE(11)
C
C *** BOUNDARY CONDITION ***
C
      ZGRID (  -1) = ZGRID( 0 )
      ZGRID (  -2) = ZGRID( 1 )
      ZGRID (NZ  ) = ZGRID( NZ-1 )
      ZGRID (NZ+1) = ZGRID( NZ-2 )
      ZGRID (NZ+2) = ZGRID( NZ-3 )
C
      PRES0 (  -1) = PRES0( 0 )
      PRES0 (  -2) = PRES0( 1 )
c      PRES0 (NZ  ) = PRES0( NZ-1 )
      PRES0 (NZ+1) = PRES0( NZ-1 )
      PRES0 (NZ+2) = PRES0( NZ-2 )
C
      PPAI0 (  -1) = PPAI0( 0 )
      PPAI0 (  -2) = PPAI0( 1 )
c      PPAI0 (NZ  ) = PPAI0( NZ-1 )
      PPAI0 (NZ+1) = PPAI0( NZ-1 )
      PPAI0 (NZ+2) = PPAI0( NZ-2 )
C
      DENS0 (  -1) = DENS0( 0 )
      DENS0 (  -2) = DENS0( 1 )
c      DENS0 (NZ  ) = DENS0( NZ-1 )
      DENS0 (NZ+1) = DENS0( NZ-1 )
      DENS0 (NZ+2) = DENS0( NZ-2 )
C
      TEMP0 (  -1) = TEMP0( 0 )
      TEMP0 (  -2) = TEMP0( 1 )
c      TEMP0 (NZ  ) = TEMP0( NZ-1 )
      TEMP0 (NZ+1) = TEMP0( NZ-1 )
      TEMP0 (NZ+2) = TEMP0( NZ-2 )
C
      TPOT0 (  -1) = TPOT0( 0 )
      TPOT0 (  -2) = TPOT0( 1 )
c      TPOT0 (NZ  ) = TPOT0( NZ-1 )
      TPOT0 (NZ+1) = TPOT0( NZ-1 )
      TPOT0 (NZ+2) = TPOT0( NZ-2 )
C
      RVAP0 (  -1) = RVAP0( 0 )
      RVAP0 (  -2) = RVAP0( 1 )
c      RVAP0 (NZ  ) = RVAP0( NZ-1 )
      RVAP0 (NZ+1) = RVAP0( NZ-1 )
      RVAP0 (NZ+2) = RVAP0( NZ-2 )
C
      QVAP0 (  -1) = QVAP0( 0 )
      QVAP0 (  -2) = QVAP0( 1 )
c      QVAP0 (NZ  ) = QVAP0( NZ-1 )
      QVAP0 (NZ+1) = QVAP0( NZ-1 )
      QVAP0 (NZ+2) = QVAP0( NZ-2 )
C
C---------------------------------------------------------------------
c      WRITE(6,*) '**DENS0 OBTAINED IN SUBROUTINE VBASIC'
c      WRITE(6,*) DENS0
C
C
      RETURN
      E N D
