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

findloc with back input and in-situ calculation of array

Klein__Ygal
Novice
1,170 Views

The following code results with successful compilation using gfortran 9.2 but fails using intel compiler 19 u5:

 

      program check_findloc
      implicit none
      logical :: just(5)
      real(8), parameter :: small = 1d-5, sep = 1d-3
      integer, parameter :: lines = 100, maxseg_in_line = 5000
      real(8) :: zline(maxseg_in_line, lines)
      integer :: n, line, l, loc
      just(1:3) = .false.
      just(4:5) = .true.
      n = findloc(just, .true., dim=1, back=.true.)
      write(*, *) n
      line = 1
      loc = maxseg_in_line / 10
      do n = 1, loc
         zline(n, line) = sep * dble(n)
      end do
      l = findloc(abs(zline(1:loc, line) - sep) > small, .true., dim=1, back=.true.)
      write(*, *) l
      end program check_findloc
 

 

The error returned by intel compiler:

 

check_findloc.f90(17): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
 

 

Amending the code a little bit - by making the subtraction outside of the findloc function (but usign the abs within it) works, i.e. the following code results with successful compilation using both gfortran 9.2 and ifort 19 u5:

 

      program check_findloc
      implicit none
      logical :: just(5)
      real(8), parameter :: small = 1d-5, sep = 1d-3
      integer, parameter :: lines = 100, maxseg_in_line = 5000
      real(8) :: zline(maxseg_in_line, lines), temporary(maxseg_in_line)
      integer :: n, line, l, loc
      just(1:3) = .false.
      just(4:5) = .true.
      n = findloc(just, .true., dim=1, back=.true.)
      write(*, *) n
      line = 1
      loc = maxseg_in_line / 10
      do n = 1, loc
         zline(n, line) = sep * dble(n)
      end do
      temporary(1:loc) = zline(1:loc, line) - sep
      l = findloc(abs(temporary(1:loc)) > small, .true., dim=1, back=.true.)
      write(*, *) l
      end program check_findloc
 

Also - omitting the back input from the findloc - makes the original source compile successfully.

 

 

The OS details:

OS : CentOS 7.5
Compiler : intel parallel studio xe/2019 update 5
gcc : 9.2.0

 

Thanks for the help.

5 Replies
Steve_Lionel
Honored Contributor III
1,170 Views

Ah, this is the program you posted in comp.lang.fortran. It still fails in 19.1. Please report it to Intel using the Online Service Center. Posting here is not guaranteed to make it to the developers.

0 Kudos
Klein__Ygal
Novice
1,170 Views

Thanks.

 

Sent the request in https://supporttickets.intel.com/?lang=en-US

Devorah_H_Intel
Moderator
1,170 Views

Thank you for reporting this. I am currently investigating this issue.

0 Kudos
Igor666
Novice
1,106 Views

Any news yet? I have the same issue.

0 Kudos
Klein__Ygal
Novice
1,170 Views
Reply