Hi,
Trying to modernise and tidy some old Fortran 77/90 code.
We have a scratch space in memory called restbuf_1 for a scientific model.
Currently our information array's are 2d and 3d, whereas the scratch is 1d. So we use Equivalence statements to slap the information from the 2d and 3d array's (rest2d_1 and rest3d_1) into the memory location of restbuf_1.
We'd like to move away from the whole equivalence thing so want to replace those chunks of code to perhaps be a bit more dynamic.
I'm perhaps having a bit of a blank day today, but does anyone have any suggestions on how to do this? Our original code is somewhat like;
I understand that Pointer's and Target's from Fortran95 cannot be used to reference to an array of different dimensions.
Thanks for any help/suggestions.
Trying to modernise and tidy some old Fortran 77/90 code.
We have a scratch space in memory called restbuf_1 for a scientific model.
Currently our information array's are 2d and 3d, whereas the scratch is 1d. So we use Equivalence statements to slap the information from the 2d and 3d array's (rest2d_1 and rest3d_1) into the memory location of restbuf_1.
We'd like to move away from the whole equivalence thing so want to replace those chunks of code to perhaps be a bit more dynamic.
I'm perhaps having a bit of a blank day today, but does anyone have any suggestions on how to do this? Our original code is somewhat like;
real rest3d_1(jj,ll,kk) ! + Master + Model1
real rest2d_1(ll,kk) ! + Master + Model1
equivalence (restbuf_1(1),rest2d_1(1,1)) ! + Master + Model1
equivalence (restbuf_1(1),rest3d_1(1,1,1))
I understand that Pointer's and Target's from Fortran95 cannot be used to reference to an array of different dimensions.
Thanks for any help/suggestions.