libsim Versione 8.0.0

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

Generated with Doxygen.