Community
cancel
Showing results for 
Search instead for 
Did you mean: 
lauhwa
Beginner
293 Views

a bug of intel fortran compiler?

Jump to solution

Recently I have tried to use "block/end block". But I found a error when I wrote some data as follow

program main
    implicit none  
    integer::i 
    i=1
    write(*,*)i,'0'
    block 
        integer::j 
        write(*,*)j,'1'
        write(*,'(<i>i8)')j
    end block

end program 

 

then, the fortran compiler return an internal error:

fortcom: Fatal: There has been an internal compiler error (C0000005).

while if I don't use block or replace "<i>I8" by 1I8, no error reported.

The fortran compiler is Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.5.281 Build 20190815 with a student license.

 

0 Kudos
1 Solution
andrew_4619
Honored Contributor I
282 Views

ICE is a compiler bug always but your code is not standard Fortran, the <i> syntax is an extension supported by some compilers. You should not use that '(*(i8))' would be any number or you could build a format at run time.

character(20) :: gf, gtmp
integer :: i
i = 2
write(gtmp,'(i0)' ) i
gf = '('//trim(gtmp)//'(i8))'
write(*,gf) i

 

View solution in original post

3 Replies
andrew_4619
Honored Contributor I
283 Views

ICE is a compiler bug always but your code is not standard Fortran, the <i> syntax is an extension supported by some compilers. You should not use that '(*(i8))' would be any number or you could build a format at run time.

character(20) :: gf, gtmp
integer :: i
i = 2
write(gtmp,'(i0)' ) i
gf = '('//trim(gtmp)//'(i8))'
write(*,gf) i

 

View solution in original post

lauhwa
Beginner
274 Views

Think you so much! It is better and common way. 

Steve_Lionel
Black Belt Retired Employee
247 Views

If you want the format to be repeated as many times as there are items or elements, then use the format:

'(*(i8))'

 

Reply