25 use ctlblk_mod,
only: num_procs, jsta, icnt, idsp, mpi_comm_comp, im,&
26 jsta_2l, jend_2u, jm, me, &
27 buff,ista_2l,iend_2u,jexa,iexa,jsxa,isxa,ista,iend
33 real,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u),
intent(in) :: a
34 real,
dimension(im,jm),
intent(out) :: b
36 real,
allocatable :: rbufs(:)
38 jj=( jexa(me)-jsxa(me)+1) * (iexa(me)-isxa(me)+1)
39 allocate( rbufs(( jexa(me)-jsxa(me)+1) * (iexa(me)-isxa(me)+1)) )
41 if ( num_procs <= 1 )
then
48 do jj=jsxa(me),jexa(me)
49 do ii=isxa(me),iexa(me)
50 if(isum .gt. im*jm .or. ii .gt. im .or. ii .lt. 1 .or. jj .gt. jm .or. jj.lt. 1) &
51 write(*,901)
' BOUNDS2 FAIL in reshape ',isum,ii,jj,im*jm,im,im*jm
59 call mpi_gatherv(rbufs,icnt(me),mpi_real, buff,icnt,idsp,mpi_real,0,mpi_comm_world, ierr )
68 if(isum .gt. im*jm .or. ii .gt. im .or. ii .lt. 1 .or. jj .gt. jm .or. jj .lt. 1) &
69 write(*,901)
' BOUNDS FAIL in reshape ',isum,ii,jj,im*jm,im,im*jm
95 use ctlblk_mod,
only: num_procs, jsta, icnt, idsp, mpi_comm_comp, im,&
96 jsta_2l, jend_2u, jm, me, &
97 buff,ista_2l,iend_2u,jexa,iexa,jsxa,isxa,ista,iend,jend
103 real,
dimension(ista:iend,jsta:jend),
intent(in) :: a
104 real,
dimension(im,jm),
intent(out) :: b
106 real,
allocatable :: rbufs(:)
107 allocate(buff(im*jm))
108 jj=( jexa(me)-jsxa(me)+1) * (iexa(me)-isxa(me)+1)
109 allocate( rbufs(( jexa(me)-jsxa(me)+1) * (iexa(me)-isxa(me)+1)) )
111 if ( num_procs <= 1 )
then
117 do jj=jsxa(me),jexa(me)
118 do ii=isxa(me),iexa(me)
119 if(isum .gt. im*jm .or. ii .gt. im .or. ii .lt. 1 .or. jj .gt. jm .or. jj.lt. 1) &
120 write(*,901)
' BOUNDS2 FAIL in reshape',isum,ii,jj,im*jm,im,im*jm
127 call mpi_allgatherv(rbufs,icnt(me),mpi_real,buff,icnt,idsp,mpi_real, mpi_comm_comp, ierr )
128 call mpi_barrier(mpi_comm_comp,ierr)
133 do jj=jsxa(n),jexa(n)
134 do ii=isxa(n),iexa(n)
135 if(isum .gt. im*jm .or. ii .gt. im .or. ii .lt. 1 .or. jj .gt. jm .or. jj .lt. 1) &
136 write(*,901)
' BOUNDS FAIL in reshape',isum,ii,jj,im*jm,im,im*jm
145 901
format(a30,10i10)