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

Behaviour of ASSOCIATE construct

Svein-Atle_Engeseth
362 Views

Hi all,
I have been trying out parameterized data types just to see how they work when passed to subroutines.
Then I thought I should use ASSOCIATE to get shorter names to work with.
That worked as expected in the main program, but not in the subroutine.
The type is:    

      TYPE :: MATRISE(K, M, N)
        INTEGER, KIND :: K = WP
        INTEGER, LEN :: M = 3
        INTEGER, LEN :: N = 4
        REAL (K), DIMENSION(M, N) :: A
      END TYPE MATRISE

Declaration in the main program
      TYPE (MATRISE(WP, 4, 1)) :: B
and the associate in the main program is
ASSOCIATE(MAT => B % A)
and this makes MAT equal to the whole matrix A, but not so when this sentence is used in a subroutine,
then the result is a zero sized matrix.
Is this a bug or to be expected?
Please see the attached program.
I use 
Intel(R) Compiler 17.0 Update 5 (package 267)
 
Regards



 
0 Kudos
1 Solution
FortranFan
Honored Contributor II
362 Views

.. not so when this sentence is used in a subroutine, then the result is a zero sized matrix. Is this a bug .. ?

Yes, it looks like a bug and it's present with Intel Fortran 18.0 update 1 as well.  As you may know, a support request at the Intel Online Service Center (OSC) will be the way to proceed:

https://supporttickets.intel.com/?lang=en-US

View solution in original post

0 Kudos
1 Reply
FortranFan
Honored Contributor II
363 Views

.. not so when this sentence is used in a subroutine, then the result is a zero sized matrix. Is this a bug .. ?

Yes, it looks like a bug and it's present with Intel Fortran 18.0 update 1 as well.  As you may know, a support request at the Intel Online Service Center (OSC) will be the way to proceed:

https://supporttickets.intel.com/?lang=en-US

0 Kudos
Reply