C     Last change:  LMY  29 Oct 2001   11:42 am
c Test program for the RDTAPE2 subroutine.
c
c Written by Lloyd M. Young, Los Alamos National Laboratory,
c Mailstop H817, Los Alamos, New Mexico 87545, USA.
**********************************************************************
* Copyright, 1965-2000, The Regents of the University of California. *
*                                                                    *
*  This software was produced under a U.S. Government contract       *
*  (W-7405-ENG-36) by Los Alamos National Laboratory, which is       *
*  operated by the University of California for the U.S. Department  *
*  of Energy.  Neither the Government nor the University makes any   *
*  warranty, express or implied, or assumes any liability or         *
*  responsibility for the use of this software.                      *
**********************************************************************
c
c  This file is provided as is without additional documentation except
c  that provided herein.
c
c  Los Alamos National Laboratory cannot provide consulting for source-
c  code developers.
c
c  The following module is required by the subroutine RDTAPE2
      module readtapeArrays
      real (KIND=4), ALLOCATABLE :: cor(:,:)
      real (KIND=4), ALLOCATABLE :: cord(:,:)
      integer (KIND=1), ALLOCATABLE ::ip(:),iicol(:)
      integer (KIND=4), ALLOCATABLE :: icol(:),map(:)
      INTEGER :: nels=1000
      INTEGER (KIND=4) :: nel ,ne,ifld,nbuf,maxj
      INTEGER (KIND=4), ALLOCATABLE :: ntype(:)
      REAL (KIND=4) :: pr , wr , wt
      REAL (KIND=4), ALLOCATABLE :: zloc(:),el(:,:),eraln(:,:)
      INTEGER (KIND=4) :: numrec,ireclen,nnx ,nplots,nstep
      CHARACTER (LEN=8) :: filename(1)
      INTEGER :: ifdate(1),ifsize(1) ,numfil=1 ,lastifsize(10)
      INTEGER, DIMENSION(10) :: itape35=(/2,36,37,38,39,40,41,42,43,44/)
      CHARACTER (LEN=88) :: ElementOutName,TimeStepOutName
      REAL (KIND=4) ::   ax,bx,xbx,ybx,exrms,xmaxrms,
     &                   ay,by,xby,yby,eyrms,ymaxrms,
     &                   az,bz,xbz,ybz,ezrms,zmaxrms
      end module
c
      program testrd
      USE readtapeArrays
c
      ne=1       !request element 1
      elementoutname="tape2.t2"
      timestepoutname="tape3.t3"
      do ne=1,100                ! request reading of element number NE =1 to 100
      call rdtape2(1,-1,ieof)
      if (ieof.ne.0) cycle
      WRITE(*,*) "ELEMENT #=", ne
      end do
c
c request first 100 records of time-step-data
      do ne=1,100
      call rdtape2(5,-1,ieof)
      WRITE(*,*) "time step record #=", nstep       !nstep is the sequential number of the time-step record
      if (ieof.ne.0 ) exit
      end do
      STOP 'normal end'
      end
c
      include 'rdtape2.for'


