UPP (develop)
Loading...
Searching...
No Matches
PARA_RANGE.f
Go to the documentation of this file.
1
10!-----------------------------------------------------------------
20 SUBROUTINE para_range (N1,N2,NPROCS,IRANK,ISTA,IEND)
21
22 implicit none
23 integer,intent(in) :: n1,n2,nprocs,irank
24 integer,intent(out) :: ista,iend
25 integer iwork1, iwork2
26
27 iwork1 = ( n2 - n1 + 1 ) / nprocs
28 iwork2 = mod( n2 - n1 + 1, nprocs )
29 ista = irank * iwork1 + n1 + min( irank, iwork2 )
30 iend = ista + iwork1 - 1
31 if ( iwork2 > irank ) iend = iend + 1
32 return
33 end
34
35! ----------------------------------------------------------------------------------------------------
46 subroutine para_range2(im,jm,nx,ny,nrank,ista,iend,jsta,jend)
47
48 implicit none
49 integer,intent(in) :: im,jm,nx,ny,nrank
50 integer,intent(out) :: ista,iend,jsta,jend
51 integer :: ix,jx
52
53 jx=nrank/nx
54 ix=nrank-(jx*nx)
55 call para_range(1,im,nx,ix,ista,iend)
56 call para_range(1,jm,ny,jx,jsta,jend)
57! print 101,n,ix,jx,ista,iend,jsta,jend
58! 101 format(16i8)
59 return
60 end
61
62
subroutine para_range(n1, n2, nprocs, irank, ista, iend)
Sets up decomposition values.
Definition PARA_RANGE.f:21