Print

Print


Manfred and Everyone Else:
	This is not something from the 1960s, but rather incomplete (and therefore
improper) editing of format edit descriptors for real data.  Some of your results come
from new features that were added to I/O in Fortran 2008.

	The forward slash (/) is the end of record edit descriptor.  Hence, the value of a
is unchanged.

	The input values of i and n for IEEE Infinity and NaN, respectively, are new in
Fortran 2008.  However, IEEE Infinity needs to be spelled either "Inf" or "Infinity",
without regard to case.  The processor cannot truncate it to just "i".  Similarly, an IEEE
NaN is spelled with "NaN" at the beginning with optional letters in parentheses following
these three letters.

	Apparently, the letters q, e, and d are interpreted as exponent specifiers.
However, they need to have at least one digit before the exponent specifier.  Also, q has
never been standard but some compilers use it to specify quad precision.

	You may wish to file a bug report with Absoft since the incomplete processing of
these input values contradicts the Fortran standard.

	Hope this helps.

Sincerely,
Craig T. Dedo
17130 W. Burleigh Place
P. O. Box 423                         Mobile Phone:  (414) 412-5869
Brookfield, WI   53008-0423    E-mail:  <[log in to unmask]>
USA
Linked-In:  http://www.linkedin.com/in/craigdedo

> -----Original Message-----
> From: Fortran 90 List [mailto:[log in to unmask]] On Behalf Of Mudelsee
> M
> Sent: Monday, February 07, 2011 12:07
> To: [log in to unmask]
> Subject: read, characters q e / i d n
> 
> 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