For Programmers: Free Programming Magazines  


Home > Archive > Fortran > February 2008 > Is this a bug of Intel Fortran Compiler 10.1?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Is this a bug of Intel Fortran Compiler 10.1?
hermitian

2008-02-19, 8:27 am

Hi, all:

I'm using Intel Fortran Compiler (IFC) 10.1 on a Linux machine. But it
seems that IFC cannot recognize a write format correctly in runtime.

The follow is a sample code:

program ex
implicit none
integer::a=123
integer::n=3
! string a_fmt will be used for the output format of integer a
character(len=2)::a_fmt="I?"
write(a_fmt(2:2),"(I1)")n
! string a_fmt is used as a format descriptor
write(*,a_fmt) a
stop
end

pgf90/pgf95 can compile and run the code without any problem, but
ifort doesn't work well in runtime.

abc@abcd:/tmp$ pgf95 ex.f90
abc@abcd:/tmp$ ./a.out
123
FORTRAN STOP
abc@abcd:/tmp$ ifort ex.f90
abc@abcd:/tmp$ ./a.out
forrtl: info (58): format syntax error at or near I3
forrtl: severe (62): syntax error in format, unit -1, file /dev/pts/0
Image PC Routine Line Source
a.out 0808E60F Unknown Unknown Unknown
a.out 0808DC2F Unknown Unknown Unknown
a.out 0806D9D2 Unknown Unknown Unknown
a.out 0805F12E Unknown Unknown Unknown
a.out 0805EDC9 Unknown Unknown Unknown
a.out 0805360B Unknown Unknown Unknown
a.out 08049BDA Unknown Unknown Unknown
a.out 08049B31 Unknown Unknown Unknown
libc.so.6 B7DDFEA8 Unknown Unknown Unknown
a.out 08049A71 Unknown Unknown Unknown

Any suggestions and ideas are welcomed!

Herman D. Knoble

2008-02-19, 8:27 am

G95 says:
At line 9 of file ifortbug.f90 (Unit 6)
Traceback: not available, compile with -ftrace=frame or -ftrace=full
Fortran runtime error: Missing initial left parenthesis in format
I3
^

Skip Knoble

On Tue, 19 Feb 2008 04:46:20 -0800 (PST), hermitian <iamwuxin@gmail.com> wrote:

-|Hi, all:
-|
-|I'm using Intel Fortran Compiler (IFC) 10.1 on a Linux machine. But it
-|seems that IFC cannot recognize a write format correctly in runtime.
-|
-|The follow is a sample code:
-|
-|program ex
-| implicit none
-| integer::a=123
-| integer::n=3
-|! string a_fmt will be used for the output format of integer a
-| character(len=2)::a_fmt="I?"
-| write(a_fmt(2:2),"(I1)")n
-|! string a_fmt is used as a format descriptor
-| write(*,a_fmt) a
-| stop
-|end
-|
-|pgf90/pgf95 can compile and run the code without any problem, but
-|ifort doesn't work well in runtime.
-|
-|abc@abcd:/tmp$ pgf95 ex.f90
-|abc@abcd:/tmp$ ./a.out
-|123
-|FORTRAN STOP
-|abc@abcd:/tmp$ ifort ex.f90
-|abc@abcd:/tmp$ ./a.out
-|forrtl: info (58): format syntax error at or near I3
-|forrtl: severe (62): syntax error in format, unit -1, file /dev/pts/0
-|Image PC Routine Line Source
-|a.out 0808E60F Unknown Unknown Unknown
-|a.out 0808DC2F Unknown Unknown Unknown
-|a.out 0806D9D2 Unknown Unknown Unknown
-|a.out 0805F12E Unknown Unknown Unknown
-|a.out 0805EDC9 Unknown Unknown Unknown
-|a.out 0805360B Unknown Unknown Unknown
-|a.out 08049BDA Unknown Unknown Unknown
-|a.out 08049B31 Unknown Unknown Unknown
-|libc.so.6 B7DDFEA8 Unknown Unknown Unknown
-|a.out 08049A71 Unknown Unknown Unknown
-|
-|Any suggestions and ideas are welcomed!

hermitian

2008-02-19, 8:27 am

Oh, that's my mistake!

I'm sorry!

The correct code should be:

program ex
implicit none
integer::a=123
integer::n=3
! string a_fmt will be used for the output format of integer a
character(len=4)::a_fmt="(I?)"
write(a_fmt(3:3),"(I1)")n
! string a_fmt is used as a format descriptor
write(*,a_fmt) a
stop
end


On Feb 19, 8:59 pm, Herman D. Knoble <SkipKnobleL...@SPAMpsu.DOT.edu>
wrote:
> G95 says:
> At line 9 of file ifortbug.f90 (Unit 6)
> Traceback: not available, compile with -ftrace=frame or -ftrace=full
> Fortran runtime error: Missing initial left parenthesis in format
> I3
> ^
>
> Skip Knoble
>
> On Tue, 19 Feb 2008 04:46:20 -0800 (PST), hermitian <iamwu...@gmail.com> wrote:
>
> -|Hi, all:
> -|
> -|I'm using Intel Fortran Compiler (IFC) 10.1 on a Linux machine. But it
> -|seems that IFC cannot recognize a write format correctly in runtime.
> -|
> -|The follow is a sample code:
> -|
> -|program ex
> -| implicit none
> -| integer::a=123
> -| integer::n=3
> -|! string a_fmt will be used for the output format of integer a
> -| character(len=2)::a_fmt="I?"
> -| write(a_fmt(2:2),"(I1)")n
> -|! string a_fmt is used as a format descriptor
> -| write(*,a_fmt) a
> -| stop
> -|end
> -|
> -|pgf90/pgf95 can compile and run the code without any problem, but
> -|ifort doesn't work well in runtime.
> -|
> -|abc@abcd:/tmp$ pgf95 ex.f90
> -|abc@abcd:/tmp$ ./a.out
> -|123
> -|FORTRAN STOP
> -|abc@abcd:/tmp$ ifort ex.f90
> -|abc@abcd:/tmp$ ./a.out
> -|forrtl: info (58): format syntax error at or near I3
> -|forrtl: severe (62): syntax error in format, unit -1, file /dev/pts/0
> -|Image PC Routine Line Source
> -|a.out 0808E60F Unknown Unknown Unknown
> -|a.out 0808DC2F Unknown Unknown Unknown
> -|a.out 0806D9D2 Unknown Unknown Unknown
> -|a.out 0805F12E Unknown Unknown Unknown
> -|a.out 0805EDC9 Unknown Unknown Unknown
> -|a.out 0805360B Unknown Unknown Unknown
> -|a.out 08049BDA Unknown Unknown Unknown
> -|a.out 08049B31 Unknown Unknown Unknown
> -|libc.so.6 B7DDFEA8 Unknown Unknown Unknown
> -|a.out 08049A71 Unknown Unknown Unknown
> -|
> -|Any suggestions and ideas are welcomed!


Steve Lionel

2008-02-19, 7:35 pm

On Feb 19, 9:17 am, hermitian <iamwu...@gmail.com> wrote:
> Oh, that's my mistake!
>
> I'm sorry!
>
> The correct code should be:


[snip]

The corrected code builds and runs fine in Intel Fortran. You may
want to send a bug report to PGI.

Steve
Dick Hendrickson

2008-02-19, 7:35 pm

hermitian wrote:
> Hi, all:
>
> I'm using Intel Fortran Compiler (IFC) 10.1 on a Linux machine. But it
> seems that IFC cannot recognize a write format correctly in runtime.
>
> The follow is a sample code:
>
> program ex
> implicit none
> integer::a=123
> integer::n=3
> ! string a_fmt will be used for the output format of integer a
> character(len=2)::a_fmt="I?"
> write(a_fmt(2:2),"(I1)")n


As others have said, 2:2 should be 3:3. But, as a general rule,
whenever you get an error message of the form "the compiler or library
is unhappy with the value of some variable" you should always rerun
the program with a print statement to display the actual value of
the variable. Once programs compile, the most common user error
is "I know for sure what the value of that variable is ;)."

Dick Hendrickson

> ! string a_fmt is used as a format descriptor
> write(*,a_fmt) a
> stop
> end
>
> pgf90/pgf95 can compile and run the code without any problem, but
> ifort doesn't work well in runtime.
>
> abc@abcd:/tmp$ pgf95 ex.f90
> abc@abcd:/tmp$ ./a.out
> 123
> FORTRAN STOP
> abc@abcd:/tmp$ ifort ex.f90
> abc@abcd:/tmp$ ./a.out
> forrtl: info (58): format syntax error at or near I3
> forrtl: severe (62): syntax error in format, unit -1, file /dev/pts/0
> Image PC Routine Line Source
> a.out 0808E60F Unknown Unknown Unknown
> a.out 0808DC2F Unknown Unknown Unknown
> a.out 0806D9D2 Unknown Unknown Unknown
> a.out 0805F12E Unknown Unknown Unknown
> a.out 0805EDC9 Unknown Unknown Unknown
> a.out 0805360B Unknown Unknown Unknown
> a.out 08049BDA Unknown Unknown Unknown
> a.out 08049B31 Unknown Unknown Unknown
> libc.so.6 B7DDFEA8 Unknown Unknown Unknown
> a.out 08049A71 Unknown Unknown Unknown
>
> Any suggestions and ideas are welcomed!
>

Gib Bogle

2008-02-20, 4:47 am

Dick Hendrickson wrote:
> hermitian wrote:
>
> As others have said, 2:2 should be 3:3.


The more significant error is in the line before this one.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com