Problem with OpenMP Reduction Clause
Richard E Maine
Richard.Maine@nasa.gov
Tue May 2 16:42:00 GMT 2006
On May 2, 2006, at 8:19 AM, Diego Novillo wrote:
>> integer, dimension(n), intent(out) :: sumarray
...
> I'm not too familiar with Fortran, but sumarray seems to be an
> assumed-size array here?
No, it is not. This is an explicit-shape array. Assumed size is
declared with a "*" for the upper bound of the last dimension.
Assumed-size arrays have many restrictions because the compiler is
not presumed to know the actual size, even at run-time. Some
compilers might implement things in a way that allows them to know,
but the standard is written to avoid requiring that (and most
compilers don't). Thus, you basically can't do anything that would
require the compiler to know the size (which means that you can't do
much).
For example, you can't do something as trivial as write out the whole
array because the compiler wouldn't know how many elements to write.
You can write out specific elements, possibly including all of them,
but the programmer has to specify the list of elements (in any of
several ways) rather than just saying to write the array.
So it isn't surprising at all that there would be restrictions on the
use of assumed-size arrays in contexts like this.
--
Richard Maine | Good judgment comes from experience;
Richard.Maine@nasa.gov | experience comes from bad judgment.
| -- Mark Twain
More information about the Fortran
mailing list