home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!noc.msc.net!uc.msc.edu!uh.msc.edu!doherty
- From: doherty@msc.edu (David C. Doherty)
- Subject: ERR= with free formatted READ on DECStation
- Message-ID: <1992Jul23.163959.10349@uc.msc.edu>
- Keywords: READ ERR DECStation f77
- Sender: doherty@uh.msc.edu (David C. Doherty)
- Reply-To: doherty@msc.edu
- Organization: Minnesota Supercomputer Center
- Date: Thu, 23 Jul 1992 16:39:59 GMT
- Lines: 84
-
- I am having problems getting the ERR= statement to work
- with a List Directed READ, using f77 on a DECStation running
- Ultrix 4.1. The compiler identifies itself as DEC Fortran V3.0-2.
- When an error occurs, it seems not to branch to the ERR= label.
- If I change the READ to formatted, an error causes it to
- branch properly.
-
- Is this a known problem or feature (like allowing character
- strings to be read into INTEGER variables)? I am relying on
- the ERR= to work properly in my code... so is there a way around this
- (perhaps a compiler switch that I haven't found)?
-
- in case my message is not clear, what follows are:
-
- 1. the input file
- 2. snippet of code with free formatted READ
- 3. output of (2)
- 4. snippet of coded with FORMATTED READ
- 5. output of (4)
-
- btw, the desired behavior is achieved with many other compilers (cf77 on
- CRAYs, f77 on IRIS (thought that this was the same mips compiler!)...)
-
- any help would be greatly appreciated,
-
- Dave Doherty
- Minnesota Supercomputer Center
- doherty@msc.edu
-
-
-
- input file ('test.dat')
- ------------------------------------------------
- 1 1 4.4000 1.5230 0.0000 0.0000
- 1 5 4.6000 1.1130 0.0000 0.0000
- bend
- 1 1 5 0.3600 109.3900 109.4100 109.4100
- 5 1 5 0.3200 109.4000 109.0000 109.0000
- 1 1 1 0.4500 109.4700 109.5100 109.5100
- ------------------------------------------------
- free-formatted READ code
- ------------------------------------------------
- program test1
- open(unit=13,file='test.dat',status='old')
- do i=1,10
- read(13,*,err=200)i,j
- 100 format(i3,x,i3)
- write(6,100)i,j
- enddo
- goto 300
- 200 stop 'i/o'
- 300 continue
- end
- ------------------------------------------------
- output of above code
- ------------------------------------------------
- 1 1
- 1 5
- 0 0
- 1 1
- 5 1
- 1 1
- i/o
- ------------------------------------------------
- formatted READ code
- ------------------------------------------------
- program test2
- open(unit=13,file='test.dat',status='old')
- do i=1,10
- read(13,100,err=200)i,j
- 100 format(i3,x,i3)
- write(6,100)i,j
- enddo
- goto 300
- 200 stop 'i/o'
- 300 continue
- end
- ------------------------------------------------
- output of above code
- ------------------------------------------------
- 1 1
- 1 5
- i/o
- ------------------------------------------------
-