libsim Versione 7.2.6

◆ arrayof_gridinfo_remove()

subroutine arrayof_gridinfo_remove ( type(arrayof_gridinfo) this,
integer, intent(in), optional nelem,
integer, intent(in), optional pos,
logical, intent(in), optional nodestroy )

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 511 del file gridinfo_class.F90.

516 ENDDO
517!$OMP END MASTER
518!$OMP END PARALLEL
519! close file
520 CALL delete(output_file)
521 ELSE
522 CALL l4f_category_log(category,l4f_error,"opening file "//trim(filename))
523 CALL raise_error()
524 ENDIF
525ELSE ! no valid grid_id has been found
526 CALL l4f_category_log(category,l4f_error, &
527 "gridinfo object of size "//t2c(this%arraysize))
528 CALL l4f_category_log(category,l4f_error, &
529 "no valid grid id found when exporting to file "//trim(filename))
530 CALL raise_error()
531ENDIF
532
533!chiudo il logger
534CALL l4f_category_delete(category)
535
536END SUBROUTINE gridinfo_export_to_file
537
538
539!> Decode and return the data array from a grid_id object associated
540!! to a gridinfo object. This method returns a 2-d array of proper
541!! size extracted from the grid_id object associated to a gridinfo
542!! object. This can work if the gridinfo object has been correctly
543!! initialised and associated to a grid from an on-disk dataset
544!! (e.g. grib_api or gdal file). The result is an array of size \a
545!! this%griddim%dim%nx X \a this%griddim%dim%ny so it must have been
546!! properly allocated by the caller.
547FUNCTION gridinfo_decode_data(this) RESULT(field)
548TYPE(gridinfo_def),INTENT(in) :: this !< gridinfo object
549REAL :: field(this%griddim%dim%nx, this%griddim%dim%ny) ! array of decoded values
550
551CALL grid_id_decode_data(this%gaid, field)
552
553END FUNCTION gridinfo_decode_data
554
555
556!> Encode a data array into a grid_id object associated to a gridinfo object.
557!! This method encodes a 2-d array of proper size into the grid_id
558!! object associated to a gridinfo object. This can work if the
559!! gridinfo object has been correctly initialised and associated to a
560!! grid_id from an on-disk (template) dataset (grib_api or gdal
561!! file). The shape of the array must be conformal to the size of the
562!! grid previously set in the gridinfo object descriptors.
563SUBROUTINE gridinfo_encode_data(this, field)
564TYPE(gridinfo_def),INTENT(inout) :: this !< gridinfo object
565REAL,intent(in) :: field(:,:) !< data array to be encoded
566
567IF (SIZE(field,1) /= this%griddim%dim%nx &

Generated with Doxygen.