Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Fortran 2008 feature of pointer rank remapping not properly diagnosed

Harald
Beginner
948 Views
Hello,

the Fortran 2008 feature of pointer rank remapping with a target that
has rank greater than 1 is not diagnosed when -stand f03 is specified:
[fortran]program ifort_pointer_assign
  implicit none
  integer, parameter :: n1 = 2, n2 = 3
  integer, target    :: base(n1,n2)
  integer, pointer   :: j(:)

  base = 0
  j(1:n1*n2) => base(:,:)       ! F2008 feature!
  print *, j(n1*n2)

end program ifort_pointer_assign
[/fortran]

% ifort ifort_pointer_assign.f90 -stand f03 -standard-semantics -warn all

(No warning produced)

% ifort -V
Intel Fortran Compiler XE for applications running on IA-32, Version 12.1.1.256 Build 20111011

0 Kudos
4 Replies
Steven_L_Intel1
Employee
948 Views
Nice catch. Thanks for pointing this out to us. I have let the developers know - the issue ID is DPD200176779.

For those who care, the relevant constraints are F2003 C720 and F2008 C718.
0 Kudos
Steven_L_Intel1
Employee
948 Views
This has been fixed for a future product release.
0 Kudos
jimdempseyatthecove
Honored Contributor III
948 Views
Steve,

>>j(1:n1*n2)=>base(:,:)!F2008feature!

This looks like a great feature and like you can eliminate convoluted TRANSFER statements.

What happens when the target is a DUMMY argument from a call using assumed shape with a stride other than 1 (of an array that had stride 1). IOW Dummy represents a logically contiguous array that isnon-contiguous in physical memory.

Jim

0 Kudos
Steven_L_Intel1
Employee
948 Views
Jim, it should work just fine. The compiler will need to generate code to compute the new strides, that's all.
0 Kudos
Reply