• R/O
  • SSH

treelm: 提交

Repository of the treelm library. Now found at https://github.com/apes-suite/treelm


Commit MetaInfo

修訂de5c54a29580581266382a2f9ca51746fbcf59dd (tree)
時間2023-05-16 01:07:43
作者Harald Klimach <harald.klimach@dlr....>
CommiterHarald Klimach

Log Message

Use elempos instead of neighpos in point identification and
register element only in one place.

Change Summary

差異

diff -r ca9e76a189eb -r de5c54a29580 source/tem_canonical_module.f90
--- a/source/tem_canonical_module.f90 Tue May 09 15:02:21 2023 +0200
+++ b/source/tem_canonical_module.f90 Mon May 15 18:07:43 2023 +0200
@@ -723,7 +723,7 @@
723723 logical, intent(in) :: shapeInverted
724724 ! --------------------------------------------------------------------------
725725 integer :: iCano, tLevel, elemPos, iElem, dPos, maxLevel, iQQN
726- integer :: neighPos, coordOfId(4)
726+ integer :: coordOfId(4)
727727 integer(kind=long_k) :: treeID, tOffset, neighID
728728 logical :: wasAdded, intersects, addToSubTree
729729 type(tem_cube_type) :: cube
@@ -744,7 +744,7 @@
744744 & maxLevel) )
745745 ! get position of the treeID in inTree
746746 elemPos = tem_PosOfId( treeID, inTree%treeID)
747- if (elemPos > 0) then
747+ elem_exists: if (elemPos > 0) then
748748 ! append the position in inTree to the map (note that already existing
749749 ! ones are omitted)
750750 call append( me = map2global, &
@@ -757,8 +757,8 @@
757757 tLevel = tem_levelOf( treeID )
758758 countElems( tLevel ) = countElems( tLevel ) + 1
759759 end if ! wasAdded
760- else
761- ! add a neighbor element of this point if any of the neighbor exist to
760+ else elem_exists
761+ ! add a neighbor element of this point if any of the neighbor exist to
762762 ! interpolate to a point
763763 coordOfId = tem_CoordOfId( treeID )
764764 tOffset = tem_FirstIdAtLevel( coordOfId(4) )
@@ -768,22 +768,26 @@
768768 & coordOfId(2) + qOffset( iQQN, 2 ), &
769769 & coordOfId(3) + qOffset( iQQN, 3 ), &
770770 & coordOfId(4) ], tOffset)
771- neighPos = tem_PosOfId( neighID, inTree%treeID)
772- if (neighPos > 0) then
773- call append( me = map2global, &
774- & pos = dpos, &
775- & val = neighPos, &
776- & wasAdded = wasAdded )
771+ elemPos = tem_PosOfId( neighID, inTree%treeID)
772+ if (elemPos > 0) then
773+ EXIT directionLoop
774+ end if
775+ end do directionLoop
776+ end if elem_exists
777+ found_elem: if (elemPos > 0) then
778+ ! append the position in inTree to the map (note that already existing
779+ ! ones are omitted)
780+ call append( me = map2global, &
781+ & pos = dpos, &
782+ & val = elemPos, &
783+ & wasAdded = wasAdded )
777784
778- ! Count up if it was added
779- if (wasAdded) then
780- tLevel = tem_levelOf( neighID )
781- countElems( tLevel ) = countElems( tLevel ) + 1
782- exit directionLoop
783- end if ! wasAdded
784- end if ! neighPos > 0
785- end do directionLoop
786- end if ! elemPos > 0
785+ ! Count up if it was added
786+ if (wasAdded) then
787+ tLevel = tem_levelOf( treeID )
788+ countElems( tLevel ) = countElems( tLevel ) + 1
789+ end if ! wasAdded
790+ end if found_elem
787791 else
788792 do iElem = 1, inTree%nElems
789793 treeID = inTree%treeID(iElem)
Show on old repository browser