Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
25 Views

-check-all issue

Jump to solution

Dear all,

when compiled with "-check all", the following simple code fails at compile time or run time depending on which line is commented:

      program test
      implicit none
      real    :: kpt(3,64)
      integer :: i,n
      n = 9
      kpt(:,n:) = kpt(:,[(i,i=64,n,-1)]) ! fails at run time
c      kpt(:,9:) = kpt(:,[(i,i=64,9,-1)]) ! fails at compile time
      end

Compile with:
ifort -check all test.f

Error message during compile time:
test.f(7): error #5581: Shape mismatch: The extent of dimension 1 of array KPT is 3 and the corresponding extent of array <RHS expression> is 56
      kpt(:,9:) = kpt(:,[(i,i=64,9,-1)]) ! fails at compile time
------^

Error message during run time:
forrtl: severe (408): fort: (33): Shape mismatch: The extent of dimension 1 of array KPT is 3 and the corresponding extent of array <RHS expression> is 56

In my opinion, the error messages are incorrect. The dimension 1 of the RHS is also 3. The dimension 2 is 56 (on both sides).

ifort --version

ifort (IFORT) 19.0.3.199 20190206
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

Thank you.

Best
Christoph

 

0 Kudos

Accepted Solutions
Highlighted
Valued Contributor I
25 Views

Yes, indeed, this seems to be

Jump to solution

Yes, indeed, this seems to be a problem with ifort, confirmed. Array bounds checking works with gfortran, NAG, and PGI.

ifort v18 also works, probably a regression.

View solution in original post

0 Kudos
4 Replies
Highlighted
Valued Contributor III
25 Views

At first glance, it does look

Jump to solution

At first glance, it does look like a bug in Intel Fortran compiler with -check:all option - I suggest submitting a support request.

0 Kudos
Highlighted
Valued Contributor I
26 Views

Yes, indeed, this seems to be

Jump to solution

Yes, indeed, this seems to be a problem with ifort, confirmed. Array bounds checking works with gfortran, NAG, and PGI.

ifort v18 also works, probably a regression.

View solution in original post

0 Kudos
Highlighted
Beginner
25 Views

Thank you. I will do that.

Jump to solution

Thank you. I will do that.

(They should have a link here to the bug report page or, even better, a button to directly file a bug report.)

0 Kudos
Highlighted
Retired Employee
25 Views

(No subject)

Jump to solution

Screenshot_3.jpg

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos