libsim  Versione6.3.0

◆ arrayof_georef_coord_array_remove()

subroutine, private georef_coord_class::arrayof_georef_coord_array_remove ( type(arrayof_georef_coord_array this,
integer, intent(in), optional  nelem,
integer, intent(in), optional  pos,
logical, intent(in), optional  nodestroy 
)
private

Method for removing elements of the array at a desired position.

If necessary, the array is reallocated to reduce space.

Parametri
thisarray object in which an element has to be removed
[in]nelemnumber of elements to remove, if not provided, a single element is removed
[in]posposition of the element to be removed, if it is out of range, it is clipped, if it is not provided, objects are removed at the end
[in]posif 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

Definizione alla linea 558 del file georef_coord_class.F90.

558 ENDIF
559 
560 IF (.NOT.shpisnull(shpobj)) THEN
561  i = shpwriteobject(shphandle, nshp, shpobj)
562  CALL shpdestroyobject(shpobj)
563 ENDIF
564 
565 END SUBROUTINE georef_coord_array_export
566 
567 
578 SUBROUTINE arrayof_georef_coord_array_import(this, shpfile)
579 TYPE(arrayof_georef_coord_array),INTENT(out) :: this
580 CHARACTER(len=*),INTENT(in) :: shpfile
581 
582 REAL(kind=fp_d) :: minb(4), maxb(4)
583 INTEGER :: i, ns, shptype, dbfnf, dbfnr
584 TYPE(shpfileobject) :: shphandle
585 
586 shphandle = shpopen(trim(shpfile), 'rb')
587 IF (shpfileisnull(shphandle)) THEN
588  ! log here
589  CALL raise_error()
590  RETURN
591 ENDIF
592 
593 ! get info about file
594 CALL shpgetinfo(shphandle, ns, shptype, minb, maxb, dbfnf, dbfnr)
595 IF (ns > 0) THEN ! allocate and read the object
596  CALL insert(this, nelem=ns)
597  DO i = 1, ns
598  CALL georef_coord_array_import(this%array(i), shphandle=shphandle, nshp=i-1)
599  ENDDO
600 ENDIF
601 
602 CALL shpclose(shphandle)
603 ! pack object to save memory
604 CALL packarray(this)
605 
606 END SUBROUTINE arrayof_georef_coord_array_import
607 
608 
Method for inserting elements of the array at a desired position.
Method for packing the array object reducing at a minimum the memory occupation, without destroying i...

Generated with Doxygen.