Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site kpno.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!kpno!brown From: brown@kpno.UUCP Newsgroups: net.lang.f77 Subject: Re: internal read problems Message-ID: <300@kpno.UUCP> Date: Tue, 20-Mar-84 21:02:00 EST Article-I.D.: kpno.300 Posted: Tue Mar 20 21:02:00 1984 Date-Received: Wed, 21-Mar-84 04:59:39 EST References: <181@wdl1.UUCP> Organization: Kitt Peak Natl. Obs. Tucson, AZ Lines: 47 The default I/O library is rather buggy as I'm sure you are finding out. The optional -lI77uc is much more predictable/bug free than the default. We have gone so far to make -lI77uc the default f77 library here. Dave Wasley at Berkeley did a nice job. > program test > read ( unit='300 ', fmt='(bn,i4)', iostat=ierror ) ispeed > if ( ierror .eq. 0 ) then > write ( *, '(''ispeed = '',i6)' ) ispeed > else > write ( *, '(''ierror = '',i6)' ) ierror > end if > end > >ierror = 20488 If you use -lI77uc to load the I/O routines the example will work correctly, ie. the example will print "ispeed = 300" >Why does the following change result in an error code so different from the >first example? > > program test > character buffer*4 > buffer = '300 ' > read ( unit=buffer, fmt='(bn,i4)', iostat=ierror ) ispeed > if ( ierror .eq. 0 ) then > write ( *, '(''ispeed = '',i6)' ) ispeed > else > write ( *, '(''ierror = '',i6)' ) ierror > end if > end > >ierror = 30616 Using -lI77uc you get the same result as the previous example..."ispeed = 300" regards, Mike Brown National Solar Observatory Tucson, Arizona (602) 325-9249 UUCP: {akgua,allegra,arizona,decvax,hao,ihnp4,lbl-csam, sdcarl,sdcsvax,seismo,trwspf,unc,utastronomy,ut-sally} !kpno!brown ARPA: kpno!brown@LBL-CSAM.ARPA CSNET: brown@arizona