pic_transpose provides a blas-less, threaded alternative to the Fortran transpose intrinsic which will be slow for large matrix sizes. pic_transpose does not assume symmetric matrices
pic_transpose is implemented for (int32, int64, sp, dp) 2d arrays
Usage: call pic_transpose(matrix_to_transpose, result, [optional] threaded, [optional] err)
This subroutine is threaded for performance purposes if threaded is set to true
The result must be shaped (cols, rows) for an input shaped (rows, cols). If it is not, the optional err argument is set to ERROR_VALIDATION; if err is absent the mismatch aborts the program with error stop, which is the historical behaviour. The result is intent(out), so on the error path it is undefined and the caller must not read it.
Note
If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism
transpose a matrix of datatype int32
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | A(:,:) | |||
| integer(kind=int32), | intent(out) | :: | B(:,:) | |||
| logical, | intent(in), | optional | :: | threaded | ||
| type(error_t), | intent(inout), | optional | :: | err |
set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop |
transpose a matrix of datatype int64
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | A(:,:) | |||
| integer(kind=int64), | intent(out) | :: | B(:,:) | |||
| logical, | intent(in), | optional | :: | threaded | ||
| type(error_t), | intent(inout), | optional | :: | err |
set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop |
transpose a matrix of datatype sp
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=sp), | intent(in) | :: | A(:,:) | |||
| real(kind=sp), | intent(out) | :: | B(:,:) | |||
| logical, | intent(in), | optional | :: | threaded | ||
| type(error_t), | intent(inout), | optional | :: | err |
set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop |
transpose a matrix of datatype dp
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | A(:,:) | |||
| real(kind=dp), | intent(out) | :: | B(:,:) | |||
| logical, | intent(in), | optional | :: | threaded | ||
| type(error_t), | intent(inout), | optional | :: | err |
set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop |