OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
rdfiles.f
Go to the documentation of this file.
1  subroutine rdfiles(infile,gdasc,nfiles,status)
2 c*****************************************************************
3 c *** program to read input file names from an ASCII file
4 c
5 c Jim Firestone, GSC/SAIC, Feb. 1993
6 c
7 c Inputs:
8 c
9 c INFILE: Char*80 - name of file containing ASCII files to read
10 c This file contains as its first line the number of files to
11 c follow, with the value written in columns 2-5. The second
12 c and subsequent lines contain the file names, one per line.
13 c
14 c Outputs:
15 c
16 c GDASC: Char(10000)*255 - names of up to 10000 files
17 c containing gridded ASCII data.
18 c
19 c NFILES: Integer - the number of files returned in the GDASC array.
20 c
21 c STATUS: Integer - status return code for the routine, 0 for normal
22 c termination or 1 if INFILE could not be read.
23 c*****************************************************************
24 c
25  implicit none
26  character infile*80, gdasc(10000)*255
27  integer nfiles, status, i, lnstrg, len
28 c
29  status = 0
30  open(9,err=998,file=infile,recl=80)
31  read(9,10) nfiles
32 10 format(i3)
33 c10 format(1x,i4)
34  do i = 1, nfiles
35  read(9,20) gdasc(i)
36 20 format(a255)
37  len = lnstrg(gdasc(i))+1
38  gdasc(i)(len:len) = achar(0)
39  end do
40  close(9)
41  goto 999
42 998 write(*,*) ' error opening file ', infile, ' terminating...'
43  status = 1
44 999 continue
45  return
46  end
subroutine rdfiles(infile, gdasc, nfiles, status)
Definition: rdfiles.f:2