Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

a bug of intel fortran compiler?

lauhwa
Novice
611 Views

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 II
600 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 II
601 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

 

lauhwa
Novice
592 Views

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

0 Kudos
Steve_Lionel
Honored Contributor III
565 Views

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

'(*(i8))'

 

Reply