* Fortran occasionally puts nulls in formatted output
@ 1995-07-14 4:00 Mark Bartelt
1995-07-20 4:00 ` Steve Lionel
0 siblings, 1 reply; 2+ messages in thread
From: Mark Bartelt @ 1995-07-14 4:00 UTC (permalink / raw)
The output of the following program has a NULL character in place of one
(and only one!) of the ASCII blanks. Specifically, two blank characters
after the 105th numeric value appear as a NULL followed by a blank.
real*8 xx(120)
data xx/120*0.0/
open(30,file='bozo.snarf',status='unknown')
write(30,100) (xx(k), k=1,120)
100 format(1p200(1x,1g10.3))
close(30)
end
If you do an "od -c bozo.snarf", you see the following at the locaction
where the error occurs:
[ ... ]
0002140 0 0 0 . 0 0 0 E + 0 0 0
0002160 . 0 0 0 E + 0 0 0 . 0 0 0 E
0002200 + 0 0 \0 0 . 0 0 0 E + 0 0
[ ... ] ^^
This should be a blank.
Fortran 3.5 under OSF/1 V3.2, by the way. Does anyone know whether it's
been fixed in some later release of Fortran?
Mark Bartelt 416/978-5619
Canadian Institute for mark@cita.toronto.edu
Theoretical Astrophysics mark@cita.utoronto.ca
"Nur eine Waffel taugt!" -- Parsifal, in an Eggo commercial
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Fortran occasionally puts nulls in formatted output
1995-07-14 4:00 Fortran occasionally puts nulls in formatted output Mark Bartelt
@ 1995-07-20 4:00 ` Steve Lionel
0 siblings, 0 replies; 2+ messages in thread
From: Steve Lionel @ 1995-07-20 4:00 UTC (permalink / raw)
In article <DBq0x9.18H@info.physics.utoronto.ca>,
sysmark@helios.physics.utoronto.ca (Mark Bartelt) writes:
|>The output of the following program has a NULL character in place of one
|>(and only one!) of the ASCII blanks. Specifically, two blank characters
|>after the 105th numeric value appear as a NULL followed by a blank.
|>
|> real*8 xx(120)
|> data xx/120*0.0/
|> open(30,file='bozo.snarf',status='unknown')
|> write(30,100) (xx(k), k=1,120)
|>100 format(1p200(1x,1g10.3))
|> close(30)
|> end
|>
|>If you do an "od -c bozo.snarf", you see the following at the locaction
|>where the error occurs:
|>
|>[ ... ]
|>0002140 0 0 0 . 0 0 0 E + 0 0 0
|>0002160 . 0 0 0 E + 0 0 0 . 0 0 0 E
|>0002200 + 0 0 \0 0 . 0 0 0 E + 0 0
|>[ ... ] ^^
|> This should be a blank.
This problem is new to us, but it is indeed a bug. It will happen when the
RTL finds it needs to extend the buffer from the default (established at
OPEN time) but the pre-extended buffer isn't completely full. Characters
remaining in the pre-extended buffer aren't properly blank filled.
We'll fix this in a future release. You can work around it by adding
RECL=nnn (where nnn is the largest recordsize you expect to use) in your
OPEN statement - this will pre-allocate that length of buffer and will avoid
the problem. If you need a product correction sooner, please submit a
problem report through your Digital software support contact.
Thanks for letting us know - though newsgroups are not a reliable method
for reporting bugs. You may send bug reports to fortran@digital.com if you
want to be sure we'll see them.
BTW - you say you are using Fortran 3.5. The current version is 3.8 and I
would highly recommend upgrading to that version.
--
Steve Lionel Mail: lionel@quark.enet.dec.com
DEC Fortran Development WWW: http://www.digital.com/info/slionel.html
Digital Equipment Corporation CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-07-20 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-07-14 4:00 Fortran occasionally puts nulls in formatted output Mark Bartelt
1995-07-20 4:00 ` Steve Lionel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox