I want to be able to have a large master array and refer to different parts of it using sub arrays. At the moment I'm using offset indices to do this, but it can get very complicated doing it this way.
Can I have a master array of dimension(9), and 3 sub arrays of dimension(3) such that sub_array1 points to the first 3 elements of the master_array, sub_array2 points to the next 3 elements and sub_array3 points to the last 3 elements?
For example, the arrays would be defined like so:
integer, dimension(9) :: master_array
integer, dimension(3) :: sub_array1, sub_array2, sub_array3
The relationship between the arrays would be:
sub_array1(1) -> master_array(1)
sub_array1(2) -> master_array(2)
sub_array1(3) -> master_array(3)
sub_array2(1) -> master_array(4)
sub_array2(2) -> master_array(5)
sub_array2(3) -> master_array(6)
sub_array3(1) -> master_array(7)
sub_array3(2) -> master_array(8)
sub_array3(3) -> master_array(9)
Furthermore, is it possible to have mixed datatypes so that I have one sub array of reals within a larger master array of integers?
Thanks in advance for the help