Using RESHAPE rather than manipulating array elements directly frees the compiler to decide the particular order of array element references that best exploits the given platform. Alternatively, DO CONCURRENT could instead free the compiler to order element accesses however is best. Trade-off: RESHAPE requires the creation of temporary array results but RESHAPE is likely to have more mature compiler support than DO CONCURRENT. If this code turns out to be a critical performance bottleneck, try replacing this implementation with element-by-element copying using DO CONCURRENT.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8k), | intent(in), | dimension(:,:) | :: | a | ||
real(kind=r8k), | intent(in), | dimension(:,:) | :: | b |