anchor.diff:  	enddo
   
   end subroutine
  +
  +subroutine DivideTriPanel(self, panelIndex) 
  +	type(SphereMesh), intent(inout) :: self
  +	integer(kint), intent(in) :: panelIndex
  +	!
  +	type(Particles), pointer :: aParticles
  +	type(Edges), pointer :: anEdges
  +	type(Panels), pointer :: aPanels
  +	logical(klog) :: edgeOrientation(3), alreadyDivided(3)
  +	
  +	!
  +	if ( aPanels%N_Max - aPanels%N < 4 ) then
  +		call LogMessage(log, WARNING_LOGGING_LEVEL, logkey, 'DivideTriPanel WARNING : ', 'not enough memory.')
  +		return
  +	endif
  +	if ( panelIndex <=0 .OR. panelIndex > aPanels%N ) then
  +		call LogMessage(log, ERROR_LOGGING_LEVEL, logKey, 'DivideTriPanel ERROR : ', ' invalid panel index.')
  +		return
  +	endif
  +	if ( aPanels%hasChildren(panelIndex) ) then
  +		call LogMessage(log, WARNING_LOGGING_LEVEL, logKey, 'DivideTriPanel WARNING : ', ' panel already has children.')
  +		return
  +	endif
  +	
  +	do j = 1, 3
  +		if ( anEdges%hasChildren( aPanels%edges(j, panelIndex) ) ) alreadyDivided(j) = .TRUE.
  +		if ( anEdges%leftPanel( aPanels%edges(j, panelIndex) ) == panelIndex ) edgeOrientation(j) = .TRUE.
  +	enddo
  +	
  +end subroutine 
   
   
   function QuadPanelArea(self,panelIndex)
  
positive.code: 	call LogMessage(log,DEBUG_LOGGING_LEVEL,logKey,'... uniform quadrilateral mesh ready.')
  end subroutine
  
  
  subroutine DividePanel(self,panelIndex)
  ! Interface to call the appropriate DividePanel subroutine.
  
negative.code: 
  	if (self%panelKind == QUAD_PANEL ) then
  		call DivideQuadPanel(self,panelIndex)
  	elseif ( self%panelKind == TRI_PANEL ) then
  		call DivideTriPanel(self, panelIndex)	
  	else
  		call LogMessage(log,ERROR_LOGGING_LEVEL,'DividePanel ERROR : ','invalid panelKind.')
  	endif
  