I want to define a PP routine that calls a fortran routine that takes
a 2D array and returns its result in the same array.
I don't fully understand the PDL::PP manual.
If I plan to always modify the pdl containing the array, should I use
PARS => '[o] b(n,m);'
as the array b is modified by the routine, or should I use
PARS => 'b(n,m);'
as the array b contains the input data. How should I manage the double
role of being both an input and output array.
If I prefer not to change the input data, I guess my pars parameter
should be something like
PARS => 'a(n,m), [o] b(n,m)';
where a is the input and b is the output. Then I would need to
initialize b with a, before calling the fortran
routine with $P(b). What is the best way to do it? I could have two nested for
loops, but I wonder if it can be done with the loop contruct, as
loop(n) %{ loop(m) %{ ... %} %}
For a one dimensional array I would use
$b()=$a();
within the innermost braces. But I couldn't find in the PDL::PP manual
how to do it in the 2D (or higher dimensional) case.
Finally, I guess I could let the user determine if he wants his input
array to be modified or not, by using 'inplace'. I understand I would
have to use a line with Inplace=>... in my pp_def, but I don't
understand how to avoid then the explicit copy in the loop above. Is
there a way of making the copy implicitly, depending on the use of
inplace?
Thanks for your advice,
Luis
--
o
W. Luis Mochán, | tel:(52)(777)329-1734 /<(*)
Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\
Apdo. Postal 48-3, 62251 | (*)/\/ \
Cuernavaca, Morelos, México | [email protected] /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general