RPN_COMM |
(RPN_COMM_transpose) |
subroutine RPN_COMM_transpose(za,min1,max1,n1g,n2,min3,max3,n3g,zb,type,size)
za | input array of size (min1:max1,n2,n3g) | Integer, R4 or R8 | I |
n1g | total number of points along the first dimension of za | Integer | I |
min3:max3, n2,n1g | size of output array zb | Integer | I |
type | integer flag for the type of tranposition needed | Integer | I |
size | word length (1 for real/integer, 2 for real*8 and so on...) | Integer | I |
zb | output array of size (size, n2, min3:max3, n1g) | same as za | O |
This routine change the mapping of the global domain on the local tiles. This
operation can be performed in both way, backward and forward, and it is determined
by the sign of "type" variable. It can also be done along x or y axis, following the absolute value of "type": 1 for x ,2 for y. If type=1 then we go from ( x/nx,y/ny, z) ->
(local y/ny,z/nx,x).
For -1, we go from (x/nx,y/ny,z) -> (z/ny,x/nx,y) where nx is the number of processes
along x axis of the processes grid, ny the same along the y axis .
+-+-+-+
|3|4|5|
+-+-+-+
|0|1|2|
+-+-+-+
we want to redistribute the grid, divinding z and x instead of x and y. We use the forward transpose ("type" >0) and we specify the needed arguments:
The input array, size (1:8,6,9) on all PE's (min1=1, max1=8, n2=6, n3g=9).
The output array, of size (6,1:5,23) on all PE's(min3=1, max3=5, n2=6, n1g=23).
We strongly recommend to obtain the values min3 and max3 with RPN_COMM_topo in order to get a trouble-free transpose. In this particular case, the call would be something like err = RPN_COMM_topo(5, min3, max3, nx3l, nxl3max, halo3x, n0_3x, .true. , .true.).
The "size" is 1 for real and integer, 2 for real*8 and so on.
When the call returns, the ouput array will contain its appropriate
part of the domain. The new grid will be of size 6 per 5+4 per 23.