Dear all,
I was puzzled by the behaviour of the Fortran 90 code below (compiled
with AbSoft 10.0, Windows XP machines, keyboard language German): the
executable took without complaining (i.e., ioerr = 0) following inputs
of mine at the read statement for the real variable and reset the a
values (in parentheses as follows:
q (a = 0)
e (a = 0)
/ (a unchanged)
i (a = INF)
d (a = 0)
n (a = NaN)
(Putting in ordinary stuff like numbers worked (ioerr .ne. 0) of course,
while putting in other unordinary stuff like $ worked not.
I have the feeling that all this is not a compilor error but a well
known Fortran behaviour since the 1960s, some old-fashioned convention.
Anyway, I would highly appreciate if someone could enlighten me in that
respect. Many thanks!
Manfred
===
program test
integer :: i
integer :: ioerr
real :: a = -999.0
print *, a
do i=1,100
print *, 'Input new value: '
read (unit=5, fmt=*, iostat=ioerr) a
print *, ' ioerr = ',ioerr,' a = ',a
end do
end program test
===
--
Dr. Manfred Mudelsee
Chief Executive Officer
Climate Risk Analysis - Manfred Mudelsee e. K. (HRA 20 13 94)
Schneiderberg 26
30167 Hannover
Germany
Telephone: +49 (0)511 7003 2891
Fax: +49 (0)511 7003 2892
Email: [log in to unmask]
URL: http://www.mudelsee.com
Research Scientist
Alfred Wegener Institute for Polar and Marine Research
Climate Science Division
Bussestrasse 24
27570 Bremerhaven
Germany
|