Hi,
I'm dealing with a bunch of arrays of different dimensions and
datatypes,
and would like to know if there's an easy way of writing a single
subroutine interface that would work with all of the arrays.
It seems a lot of work to have to declare specific subroutine interfaces
for each different type of array (i.e. rank2_real, rank2_int,
rank3_float, etc).
I know I can make generic subroutines out of all of these specific
interfaces,
but I'm feeling lazy and want to know if there's some way I can avoid
writing all of the specific interfaces in the first place.
Can I declare the dummy argument in the subroutine to be a
real, dimension(:), and then somehow mash a 3-d real array
into that dummy vector? I could probably do it if I explicitly
declare a new array and "pack" the existing 3-d array into the
new 1-d one, but I'd be interested to know if there's a way of
passing the 3-d array into a 1-d one inside the subroutine without
a call to "pack".
I guess that I'm out of luck as far as the different datatypes go -
as far as I know there's no such thing as a void * in Fortran.
Thanks,
Catherine
|