Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / external / io_adios2 / transpose.code
blob042df83e1a96b16f724bd386cf63bacfa05d4707
1   ix=0
2   jx=0
3   kx=0
4   call reorder(MemoryOrder,MemO)
5   if(IACHAR(MemO(1:1)) > MaxUpperCase) ix=i2+i1
6   if(IACHAR(MemO(2:2)) > MaxUpperCase) jx=j2+j1
7   if(IACHAR(MemO(3:3)) > MaxUpperCase) kx=k2+k1
9 ! pjj/cray
10   if(IO == 'write') then
11 !dir$ concurrent
12 !$OMP PARALLEL DO SCHEDULE(RUNTIME) PRIVATE(i,j,k)
13      do k=k1,k2
14         do j=j1,j2
15 !dir$ prefervector
16 !dir$ concurrent
17 !cdir select(vector)
18            do i=i1,i2
19               DFIELD = Field(1:di,abs(ix-i),abs(jx-j),abs(kx-k))
20            enddo
21         enddo
22      enddo
23 !$OMP END PARALLEL DO
24   else
25 !dir$ concurrent
26 !$OMP PARALLEL DO SCHEDULE(RUNTIME) PRIVATE(i,j,k)
27      do k=k1,k2
28         do j=j1,j2
29 !dir$ prefervector
30 !dir$ concurrent
31 !cdir select(vector)
32            do i=i1,i2
33               Field(1:di,abs(ix-i),abs(jx-j),abs(kx-k)) = DFIELD
34            enddo
35         enddo
36      enddo
37 !$OMP END PARALLEL DO
38   endif
40   return