home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!sgi!twilight!dinkum!calvin
- From: calvin@dinkum.mti.sgi.com (Calvin H. Vu)
- Newsgroups: comp.sys.sgi
- Subject: Re: Namelist-directed input in SGI Fortran?
- Message-ID: <v5sta0g@twilight.wpd.sgi.com>
- Date: 21 Jan 93 22:16:51 GMT
- References: <1993Jan21.202525.2050@netnews.whoi.edu>
- Sender: news@twilight.wpd.sgi.com ( CNews Account at twilight.wpd.sgi.com )
- Organization: Silicon Graphics, Inc. Mountain View, CA
- Lines: 52
-
- In <1993Jan21.202525.2050@netnews.whoi.edu> scotty@eos-prog.whoi.edu (Scott J. McCue) writes:
-
-
- > I've been tasked to port a Fortran 77 program from VAX-11 Fortran (version unknown,
- >circa 1987) to SGI Fortran (3.4.1). I'm relatively weak in Fortran. The VAX-11 code
- >uses namelist-directed READs of input files with form:
-
- > Examination of the SGI _Fortran 77 language Reference Manual_, as well as dinking
- >around with a small i/o program and the original input file(s), suggests that the VAX-11
- >version of the input fileis incorrect for SGI in at least two ways:
-
- >1. a READ to an array, i.e. several values per _item_, isn't supported.
- >2. more than one _group-name_ per file isn't supported.
-
- Both of these are false. Probably you ran into some other problems,
- not those described above.
-
- >My question(s):
- > Is this correct? Or does SGI Fortran indeed support arrays in the namelist as well as
- >multiple namelists per file? If the latter and not the former, please provide a template
- >of the input file form.
- This is an example of the program and the input file:
-
- Test program:
- dimension arr1(5), arr2(5)
- namelist /nm1/ arr1
- namelist /nm2/ arr2
- read (5, nml=nm1)
- read (5, nml=nm2)
- print *, arr1, '\n', arr2
- end
-
- Input file:
- $nm1 arr1 = 1, 2, 3, 4, 5
- $end
- $nm2 arr2(5) = 10, arr2 = 6, 7, 8, 9
- $end
-
- Running with "a.out < inputfile" gives:
- 1.000000 2.000000 3.000000 4.000000 5.000000
-
- 6.000000 7.000000 8.000000 9.000000 10.00000
-
-
- >Thanks in advance
- >Scott M.
- >scotty@eos-prog.whoi.edu
-
- If you still have problems then send me a small test case and sample input
- file and I'll take a look at it.
-
- - calvin
-