anchor.diff:             write(0,*) "seach_polygon_by_side, search count overflow ", this_polygon%index, p
              stop
            end if
  +
  +!!$         write(0,*)'search_polygon_by_side:search_count:',search_count
   
            call search_next_polygon(xs, ys, xe, ye, x, y, current_polygon, next_polygon)
            if (.not.associated(next_polygon)) exit searchloop
  
positive.code:         ye = this_polygon%point(pe)%ptr%y
  
          if (abs(xe-xs) < 180.d0) then
            delta_x = (xe-xs)/100.d0
          else
            if (xs>=xe) then
              delta_x = (xe-xs+360.d0)/100.d0
            else
              delta_x = (xe-xs-360.d0)/100.d0
            end if
          end if
  
          delta_y = (ye-ys)/100.d0
  
         current_polygon => this_polygon%point(p)%ptr%target_polygon
         if (.not.associated(current_polygon)) cycle ! next ploop
  
negative.code: 
        end do ploop
  
  contains
    !=======+=========+=========+=========+=========+=========+=========+=========+
  
    subroutine search_next_polygon(xs, ys, xe, ye, x, y, current_polygon, next_polygon)
      use jcf_spherical_lib, only : get_intersection_point
      implicit none
      real(kind=8), intent(IN) :: xs, ys, xe, ye
      real(kind=8), intent(OUT) :: x, y
      type(polygon_type), pointer :: current_polygon
      type(polygon_type), pointer :: next_polygon
      real(kind=8) :: x1, y1, x2, y2
      integer :: i1, i2
      logical :: do_intersect
  
      do i1 = 1, current_polygon%num_of_point
        i2 = mod(i1, current_polygon%num_of_point) + 1
        x1 = current_polygon%point(i1)%ptr%x
        y1 = current_polygon%point(i1)%ptr%y
        x2 = current_polygon%point(i2)%ptr%x
        y2 = current_polygon%point(i2)%ptr%y
        call get_intersection_point(&
             &  x, y, do_intersect,&
             & xs,ys,xe,ye,x1,y1,x2,y2 )
  !!$        write(0,*)'search_next_polygon:'
  !!$        write(0,*)'  i1,i2',i1,i2
  !!$        write(0,*)'  do_intersect:',do_intersect
  !!$        write(0,*)'  xs,ys,xe,ye',xs,ys,xe,ye
  !!$        write(0,*)'  x1,y1,x2,y2',x1,y1,x2,y2
  !!$        write(0,*)'  x, y ',x,y
        if ( do_intersect ) then
          next_polygon => current_polygon%next_polygon(i1)%ptr
          return
        end if
      end do
  
      nullify(next_polygon)
      x = 9999.d0
      y = 9999.d0
  
    end subroutine search_next_polygon
  end subroutine search_polygon_by_side
  !=======+=========+=========+=========+=========+=========+=========+=========+
  
  recursive subroutine search_polygon_from_point(mx, my, p_num, polygons, target_polygon, level, &
  