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

Behaviour of ASSOCIATE construct

Jump to solution

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

Accepted Solutions
Highlighted
Honored Contributor I
27 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
Highlighted
Honored Contributor I
28 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