libsim  Versione6.3.0

◆ arrayof_georef_coord_array_delete()

subroutine arrayof_georef_coord_array_delete ( type(arrayof_georef_coord_array this,
logical, intent(in), optional  nodestroy,
logical, intent(in), optional  nodealloc 
)

Destructor for finalizing an array object.

If defined, calls the destructor for every element of the array object; finally it deallocates all the space occupied.

Parametri
thisarray object to be destroyed
thisif provided and .TRUE. , the destructor possibily defined for the TYPE(georef_coord_array) is not called for every deleted object, may be useful if the objects to be deleted have been copied to another instance of arrayof_georef_coord_array and continue their life there
[in]nodeallocif provided and .TRUE. , the space reserved for the array is not deallocated, thus the values are retained, while the array pointer is nullified, this means that the caller must have previously assigned the pointer contents thisarray to another pointer to prevent memory leaks

Definizione alla linea 621 del file georef_coord_class.F90.

621 IF (this%arraysize > 0) THEN
622  shphandle = shpcreate(trim(shpfile), this%array(1)%topo)
623 ELSE
624  shphandle = shpcreate(trim(shpfile), georef_coord_array_polygon)
625 ENDIF
626 IF (shpfileisnull(shphandle)) THEN
627  ! log here
628  CALL raise_error()
629  RETURN
630 ENDIF
631 
632 DO i = 1, this%arraysize
633  CALL georef_coord_array_export(this%array(i), shphandle=shphandle, nshp=i-1)
634 ENDDO
635 
636 CALL shpclose(shphandle)
637 
638 END SUBROUTINE arrayof_georef_coord_array_export
639 #endif
640 
652 FUNCTION georef_coord_inside(this, poly) RESULT(inside)
653 TYPE(georef_coord), INTENT(IN) :: this
654 TYPE(georef_coord_array), INTENT(IN) :: poly
655 LOGICAL :: inside
656 
657 INTEGER :: i
658 
659 inside = .false.
660 IF (.NOT.c_e(this)) RETURN
661 IF (.NOT.ALLOCATED(poly%coord)) RETURN
662 ! if outside bounding box stop here
663 IF (poly%bbox_updated) THEN
664  IF (.NOT.georef_coord_inside_rectang(this, poly%bbox(1), poly%bbox(2))) RETURN
665 ENDIF
666 
667 IF (ALLOCATED(poly%parts)) THEN
668  DO i = 1, SIZE(poly%parts)-1
669  inside = inside .NEQV. pointinpoly(this%x, this%y, &
670  poly%coord(poly%parts(i)+1:poly%parts(i+1))%x, &
671  poly%coord(poly%parts(i)+1:poly%parts(i+1))%y)
672  ENDDO

Generated with Doxygen.