create the intermediate, static list totalPnt, which holds pointers to the
elem%TID list, but in an ordered fashion. The order is the same as it will
be in the total list later on, i.e.: fluid, ghostFC, ghostFF, halo.
this four sub-lists are within sorted by their treeID.
Additionally, the process-wise collections of halo elements are collected
into haloList by grouping the treeIDs according to their belonging process
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
subroutine identify_lists(me)! -------------------------------------------------------------------- !!> the level descriptor to be filledtype(tem_levelDesc_type),intent(inout)::me! -------------------------------------------------------------------- !integer::iElem,indEleminteger::iPnt(eT_minNumber:eT_maxNumber),eType,iVal! -------------------------------------------------------------------- !! Destroy listscall tem_halo_destroy(me%haloList)! init listscall tem_halo_init(me%haloList)! --------------------------------------------------------------------------! 1. count nElemsme%nElems=sum(me%elem%nElems(eT_minRelevant:eT_maxRelevant))&&+me%elem%nElems(et_distributedGhostFromFiner)call set_offsets(me=me%offset(:,:),&&nFluids=me%elem%nElems(eT_fluid),&&nGhostFC=me%elem%nElems(eT_ghostFromCoarser),&&nGhostFF=me%elem%nElems(eT_ghostFromFiner)&&+me%elem%nElems(eT_distributedGhostfromFiner),&&nHalos=me%elem%nElems(eT_halo))! --------------------------------------------------------------------------if(allocated(me%totalPnt))deallocate(me%totalPnt)allocate(me%totalPnt(me%nElems))me%totalPnt=-1! Reset pointers to current eType element in the total list! @todo: first add fluid. do not have to follow sorted order here.iPnt=0do indElem=1,me%elem%tID%nVals! Access sorted list to maintain locality of space-filling curve orderiElem=me%elem%tID%sorted(indElem)eType=me%elem%eType%val(iElem)if(eType==eT_distributedGhostFromFiner)theneType=eT_ghostFromFinercall changeType(me%elem,iElem,eT_ghostFromFiner)end if! increase counter for current elementiPnt(eType)=iPnt(eType)+1! is the eType a required element (fluid, ghost or halo)?! Get rid of nonExistent elements here.if(eType>=eT_minRelevant.and.eType<=eT_maxRelevant)then! Add sorted position of tID to the pointerme%totalPnt(me%offset(1,eType)+iPnt(eType))=iElem! And add the haloList for halo elementsif(eType==eT_halo)then! get the process from where to get the element! Create an entry in the process list for the current source processcall tem_halo_append(me=me%haloList,&&proc=me%elem%sourceProc%val(iElem),&&elemPos=iElem)end if! eT_haloend if! ( eType >= eT_minRelevant )end do! indElem! Security check! Check if there are no entries < 1do iElem=1,me%nElemsif(me%totalPnt(iElem)<1)then write(dbgUnit(1),*)"Error: Found index < 1 in the totalPnt array."write(dbgUnit(1),*)'Abort!'write(dbgUnit(1),*)'offset: '&&//trim(tem_toStr(me%offset(1,:),'; '))do iVal=1,me%nElemswrite(dbgUnit(1),*)'totalPnt: ',me%totalPnt(iVal)end do call tem_abortend if enddo end subroutine identify_lists