libsim  Versione7.2.1

◆ arrayof_gridinfo_remove()

subroutine, private gridinfo_class::arrayof_gridinfo_remove ( type(arrayof_gridinfo 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(gridinfo_def) is not called for every deleted object, may be useful if the objects to be deleted have been copied to another instance of arrayof_gridinfo and continue their life there

Definizione alla linea 526 del file gridinfo_class.F90.

526 !! object. This can work if the gridinfo object has been correctly
527 !! initialised and associated to a grid from an on-disk dataset
528 !! (e.g. grib_api or gdal file). The result is an array of size \a
529 !! this%griddim%dim%nx X \a this%griddim%dim%ny so it must have been
530 !! properly allocated by the caller.
531 FUNCTION gridinfo_decode_data(this) RESULT(field)
532 TYPE(gridinfo_def),INTENT(in) :: this
533 REAL :: field(this%griddim%dim%nx, this%griddim%dim%ny) ! array of decoded values
534 
535 CALL grid_id_decode_data(this%gaid, field)
536 
537 END FUNCTION gridinfo_decode_data
538 
539 
547 SUBROUTINE gridinfo_encode_data(this, field)
548 TYPE(gridinfo_def),INTENT(inout) :: this
549 REAL,intent(in) :: field(:,:)
550 
551 IF (SIZE(field,1) /= this%griddim%dim%nx &
552  .OR. SIZE(field,2) /= this%griddim%dim%ny) THEN
553  CALL l4f_category_log(this%category,l4f_error, &
554  'gridinfo_encode: field and gridinfo object non conformal, field: ' &
555  //trim(to_char(SIZE(field,1)))//'X'//trim(to_char(SIZE(field,2)))//', nx,ny:' &
556  //trim(to_char(this%griddim%dim%nx))//'X'//trim(to_char(this%griddim%dim%ny)))
557  CALL raise_error()
558  RETURN
559 ENDIF
560 
561 CALL grid_id_encode_data(this%gaid, field)
562 
563 END SUBROUTINE gridinfo_encode_data
564 
565 
566 ! =========================================
567 ! grib_api driver specific code
568 ! could this be moved to a separate module?
569 ! =========================================
570 #ifdef HAVE_LIBGRIBAPI
571 SUBROUTINE gridinfo_import_gribapi(this, gaid)
572 TYPE(gridinfo_def),INTENT(inout) :: this ! gridinfo object
573 INTEGER, INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to import
574 
575 call time_import_gribapi(this%time, gaid)
576 call timerange_import_gribapi(this%timerange,gaid)
577 call level_import_gribapi(this%level, gaid)

Generated with Doxygen.