title: Passing a user defined data type allocatable array
body: <p>I can define a user defined data type with allocatable array as its data type. </p>
  
  <p>Allocation works perfectly while we are still in the same subroutine. 
  But i don't know how to pass this type of user defined data type as a subroutine argument.</p>
  
  <p>Intel compiler shows the error <code># 6530</code>: </p>
  
  <pre><code>"Error  1    error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression."
  </code></pre>
  
  <p>The code has been shared below to show the error. It is written in FORTRAN 77. I am working in FORTRAN 77, as i will have to append this code in user subroutine of Abaqus that accepts only FORTRAN 77 files.</p>
  
  <hr>
  
  <pre><code>  PROGRAM DERIVED_DATA_TYPE_CHECK
  
    IMPLICIT NONE
  
    INTEGER :: I,J,A,B
    TYPE SS
        SEQUENCE
        DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: S1
    END TYPE SS
  
    TYPE (SS),DIMENSION(:,:),ALLOCATABLE :: SS_
  
    A=10
    B=10
  
    ALLOCATE (SS_(A,B))
    ! ALLOCATING THE VARIABLE S1 DIMENSIONS
    ! EVERY ALLOCATABLE VARIABLE HAS THE SAME SIZE AS
    ! THE TOTAL NUMBER OF STRUCTURE (TYPE)
    DO I = 1,A
        DO J = 1,B
            ALLOCATE(SS_(I,J)%S1(A,B))
        ENDDO
    ENDDO
  
    CALL PASS_ARG(SS_,A,B)
  
    END
  
  
    SUBROUTINE PASS_ARG(SS_,A,B)
  
    IMPLICIT NONE
  
    INTEGER :: A,B
  
    TYPE SS
        SEQUENCE
        DOUBLE PRECISION, DIMENSION(A,B) :: S1
    END TYPE SS
  
    TYPE (SS), DIMENSION (A,B) :: SS_
  
    END
  </code></pre>
  
  <hr>
  
  <p>The program at compilation gives the error as shown below:</p>
  
  <pre><code>----------
  Error   2    error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [S1]   
  ----------
  </code></pre>
  
  <p>There must be a way to solve this problem. I want to stay away from common blocks or modules. Anyway I cant use module in Fortran.</p>
  
  <p>In order to avoid this error, I had used allocatable variables in main program as well as called subroutine. Program is then compiled, but on execution, it show the error "that allocation has been done more than once". </p>
  
  <p>At last I think I will have to use some global constants..... I guess.</p>