Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

invalid REAL error message

247 views
Skip to first unread message

Friedrich

unread,
Aug 17, 2010, 12:44:45 PM8/17/10
to
Hello everyone,

please help. I have a small program

IMPLICIT NONE
REAL D1,AEA0
INTEGER IZ,NR
OPEN(UNIT=3,FILE='DATA.TXT')

READ(3,*)D1,IZ,AEA0,NR

WRITE(*,1211)D1,IZ,AEA0,NR
1211 FORMAT(/,
> ' RADIUS D =',F10.2,' mm',/,
> ' NO OF BLADES Z =',I5,/,
> ' AREA RATIO Ae/Ao =',F8.3,/,
> ' NO OF RADII NR =',I5,/)
READ(*,*)
END

and it reads the file which is below (copy pasted, although you are
probably interested only in the first line).

311.00 3 0.45 9
0.19293 30.00 480.00 97.00 17.0 11.50 11.50 0.00
0.38585 60.00 487.58 103.80 34.8 10.00 10.00 0.00
0.57878 90.00 515.94 106.00 54.5 8.00 8.00 0.00
0.70740 110.00 546.37 101.00 68.6 6.50 6.50 0.00
0.80386 125.00 575.26 87.70 78.0 5.00 5.00 0.00
0.90032 140.00 609.33 62.30 87.5 2.50 2.50 0.00
0.95177 148.00 629.63 46.00 89.8 2.00 2.00 0.00
0.98071 152.50 641.70 21.50 90.5 1.30 1.30 0.00
1.00000 155.50 650.00 0.00 97.5 0.00 0.00 0.00

On CVF 6.6 it gives the error "invalid REAL", and on IFORT 11 it gives
"severe(59)" error, which upon searching in help was explained as
"List-directed I/O syntax error". Operating system is Windows XP.

Now, I know this is something simple, but I just cannot see it (my
tireness probably helps).

If anyone knows; what is the usual thing that causes this error or
sees it in the above, I'd be really grateful for a comment or two on
the subject.

Kind regards,
Friedrich

dpb

unread,
Aug 17, 2010, 12:47:19 PM8/17/10
to
Friedrich wrote:
> Hello everyone,
>
> please help. I have a small program
>
> IMPLICIT NONE
> REAL D1,AEA0
> INTEGER IZ,NR
> OPEN(UNIT=3,FILE='DATA.TXT')
>
> READ(3,*)D1,IZ,AEA0,NR
>
...

>
> and it reads the file which is below (copy pasted, although you are
> probably interested only in the first line).
>
> 311.00 3 0.45 9
> 0.19293 30.00 480.00 97.00 17.0 11.50 11.50 0.00
...

> On CVF 6.6 it gives the error "invalid REAL", and on IFORT 11 it gives
> "severe(59)" error, which upon searching in help was explained as
> "List-directed I/O syntax error". Operating system is Windows XP.
>
> Now, I know this is something simple, but I just cannot see it (my
> tireness probably helps).
>
> If anyone knows; what is the usual thing that causes this error or
> sees it in the above, I'd be really grateful for a comment or two on
> the subject.
...

My crystal ball says you've got either a tab or other nonprinting
character in the file instead of just space/blank-separated fields.

Look at the file in a hex editor to see if that isn't the case or open
in an editor that has the facility to convert on save tabs to spaces or
do a character substitution.

--

glen herrmannsfeldt

unread,
Aug 17, 2010, 1:04:19 PM8/17/10
to
Friedrich <friedrich...@wahoo.with.a.y.com> wrote:
> please help. I have a small program

> IMPLICIT NONE
> REAL D1,AEA0
> INTEGER IZ,NR
> OPEN(UNIT=3,FILE='DATA.TXT')
> READ(3,*)D1,IZ,AEA0,NR
> WRITE(*,1211)D1,IZ,AEA0,NR
> 1211 FORMAT(/,
> > ' RADIUS D =',F10.2,' mm',/,
> > ' NO OF BLADES Z =',I5,/,
> > ' AREA RATIO Ae/Ao =',F8.3,/,
> > ' NO OF RADII NR =',I5,/)
> READ(*,*)
> END

> and it reads the file which is below (copy pasted, although you are
> probably interested only in the first line).

> 311.00 3 0.45 9

My only thought so far is that there is an invisible control
character in your file, most commonly tab.

I don't see any in the posted data, but it is possible that
cut/paste removes them.

-- glen

Gordon Sande

unread,
Aug 17, 2010, 1:19:09 PM8/17/10
to

I have an editor with a "Show Invisibles" option. Less fuss for the
same problem.

robin

unread,
Aug 17, 2010, 8:28:45 PM8/17/10
to
"Friedrich" <friedrich...@wahoo.with.a.y.com> wrote in message news:5del665h3d7es55fo...@4ax.com...

You could try changing the device number from 3 to 10.


Klaus Wacker

unread,
Aug 18, 2010, 7:47:34 AM8/18/10
to

I see lots of tabs in the original posting, both in the Fortran source
and in the data. Only the first line of the data doesn't have any.

My suspicion is that the tabs are the problem and that the fact, that
there are no tabs in the first line of the data is a cut&paste
artefact.

Another more remote possibilty that occured to me since the OP's name
sounds German: The system may be setup to expect a decimal comma
instead of a point.


--
Klaus Wacker klaus....@udo.edu
Experimentelle Physik V http://www.physik.uni-dortmund.de/~wacker
TU Dortmund Tel.: +49 231 755 3587
D-44221 Dortmund Fax: +49 231 755 4547

Friedrich

unread,
Aug 18, 2010, 1:51:22 PM8/18/10
to
On Wed, 18 Aug 2010 11:47:34 +0000 (UTC), Klaus Wacker
<wac...@physik.tu-dortmund.de> wrote:

>> My only thought so far is that there is an invisible control
>> character in your file, most commonly tab.
>>
>> I don't see any in the posted data, but it is possible that
>> cut/paste removes them.
>>
>
>I see lots of tabs in the original posting, both in the Fortran source
>and in the data. Only the first line of the data doesn't have any.
>
>My suspicion is that the tabs are the problem and that the fact, that
>there are no tabs in the first line of the data is a cut&paste
>artefact.
>
>Another more remote possibilty that occured to me since the OP's name
>sounds German: The system may be setup to expect a decimal comma
>instead of a point.


All valid guesses, but no such luck. In this case the problem was in
the encoding - this data was written as a text file from Excel
(exported from Excel in which it was written purely for convenience),
and it was written instead of in ANSI or something similar, in Unicode
BOM encoding (as Notepad2 reports).

The first line was different because I thought maybe I used a small L
instead of a 1, or some such error, so I rewrote it by hand.

I hate this kind of errors - silly, yet a day wasted :-(

But I appreciate the answer; gave me some also important things to
watch out should something like this ever pop up again.

With regards,
Friedrich

glen herrmannsfeldt

unread,
Aug 18, 2010, 3:00:49 PM8/18/10
to
Friedrich <friedrich...@wahoo.with.a.y.com> wrote:
(snip)

> All valid guesses, but no such luck. In this case the problem was in
> the encoding - this data was written as a text file from Excel
> (exported from Excel in which it was written purely for convenience),
> and it was written instead of in ANSI or something similar, in Unicode
> BOM encoding (as Notepad2 reports).

> The first line was different because I thought maybe I used a small L
> instead of a 1, or some such error, so I rewrote it by hand.

Just what not to do when asking for help with a problem.

As with problems with program statements, the problem is likely
not where you think it is, and not posting the exact data can
confuse people trying to discover the problem.

-- glen

0 new messages