Dynamic Dimensions of Arrays -
is possible make dimension of array allocatable? (not size of dimension)
i.e., giving:
real, dimension(:,:,: ... n), allocatable :: array
i mean in array of arrays sense, can preserving fortran's accessible array structure? there this, first answer not satisfy need. second answer uses pointers. work?
no, not possible have array variable rank. fortran 2008 standard, cl. 2.4.6 "array":
1 array may have fifteen dimensions, , extent in dimension. size of array total number of elements, equal product of extents. array may have 0 size. shape of array determined rank , extent in each dimension, , represented rank-one array elements extents. all named arrays shall declared, , rank of named array specified in declaration. rank of named array, once declared, constant; extents may constant or may vary during execution.
[emphasis mine.]
however, have one-dimensional array extent product(extent in each dimension)
, , index elements appropriately.
you have multi-dimensional pointers associated these 1d-arrays. take care of indexing you, (as given in citation), limited 15 dimensions standard fortran.
Comments
Post a Comment