Get first available igrid on processor ipe
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ipe |
integer function getnode(ipe) use mod_forest, only: igrid_inuse use mod_global_parameters integer, intent(in) :: ipe integer :: igrid, igrid_available igrid_available=0 do igrid=1,max_blocks if (igrid_inuse(igrid,ipe)) cycle igrid_available=igrid exit end do if (igrid_available == 0) then getnode = -1 print *, "Current maximum number of grid blocks:", max_blocks call mpistop& ("Insufficient grid blocks; increase max_blocks in meshlist") else getnode=igrid_available igrid_inuse(igrid,ipe)=.true. end if if (ipe==mype) then ! initialize node on host and device node(1:nodehi,getnode) = 0 rnode(1:rnodehi,getnode) = zero end if end function getnode