title: Are anonymous arrays possible in fortran?
body: <p>I am trying to create an array of arrays in Fortran.</p>
  
  <p>Something like the following</p>
  
  <pre><code>TYPE :: array_of_arrays
     REAL, DIMENSION(:), POINTER :: p =&gt; NULL()
  END TYPE
  
  TYPE(array_of_arrays), DIMENSION(2) :: some_array
  </code></pre>
  
  <p>So that I can do:</p>
  
  <pre><code>REAL, DIMENSION(3), TARGET :: some_vector1 = (/1.0, 2.1, 4.3/)
  REAL, DIMENSION(3), TARGET :: some_vector2 = (/3.0, 1.2, 9.6/)
  
  some_array(1)%p =&gt; some_vector1
  some_array(2)%p =&gt; some_vector2
  
  WRITE(*,*) some_array(1)%p ! I see some_vector1
  WRITE(*,*) some_array(2)%p ! I see some_vector2
  </code></pre>
  
  <p>Now it's cumbersome for me to actually declare each of these <code>some_vector</code> arrays to correspond to each element in my array of arrays.</p>
  
  <p>What I'd like to do is have in a separate subroutine where a temporary vector is set as a target, and that subroutine sets up my array of arrays to point to that temporary vector.</p>
  
  <p>This way I can have anonymous arrays.</p>
  
  <p>However, this doesn't seem to be working and I wonder if first if I am doing something that Fortran doesn't support.</p>
  
  <p>So does Fortran support anonymous arrays, that is (in case I have the terms wrong), an array who can only be accessed through a reference?</p>