libsim  Versione 7.1.6

◆ grid_id_new()

type(grid_id) function grid_id_class::grid_id_new ( type(grid_file_id), intent(inout), optional, target  from_grid_file_id,
character(len=*), intent(in), optional  grib_api_template,
integer, intent(in), optional  grib_api_id,
integer, intent(in), optional  no_driver_id 
)

Constructor for the grid_id class.

It gets the next grid (grib message or raster band) from the file_id provided. If the file associated to the file_id provided contains no more grids, or if the argument file_id is not provided, an empty object is created; this condition can be tested with the function c_e(). Alternative ways to define the object (to be used in rare cases) are through a grib_api template file name (grib_api_template argument) or through a grib_api integer id obtained directly from grib_api calls (grib_api_id argument).

Parametri
[in,out]from_grid_file_idfile object from which grid object has to be created
[in]grib_api_templategrib_api template file from which grid_object has to be created
[in]grib_api_idgrib_api id obtained directly from a grib_get subroutine call

Definizione alla linea 613 del file grid_id_class.F90.

615 !! driver; 'none' is retured if the object is empty.
616 FUNCTION grid_file_id_get_driver(this) RESULT(driver)
617 TYPE(grid_file_id),INTENT(in) :: this
618 CHARACTER(len=LEN(driverlist)) :: driver
619 
620 IF (this%driver > 0 .AND. this%driver <= SIZE(driverlist)) THEN
621  driver = driverlist(this%driver)
622 ELSE
623  driver = driverlist(0)
624 ENDIF
625 
626 END FUNCTION grid_file_id_get_driver
627 
628 
633 FUNCTION grid_id_get_driver(this) RESULT(driver)
634 TYPE(grid_id),INTENT(in) :: this
635 CHARACTER(len=LEN(driverlist)) :: driver
636 
637 IF (this%driver > 0 .AND. this%driver <= SIZE(driverlist)) THEN
638  driver = driverlist(this%driver)
639 ELSE
640  driver = driverlist(0)
641 ENDIF
642 
643 END FUNCTION grid_id_get_driver
644 
645 
652 SUBROUTINE grid_id_display(this, namespace)
653 TYPE(grid_id),INTENT(in) :: this
654 CHARACTER(len=*),OPTIONAL :: namespace
655 
656 INTEGER :: kiter, iret
657 CHARACTER(len=255) :: key, value, lnamespace
658 
659 
660 #ifdef HAVE_LIBGRIBAPI
661 IF (this%driver == grid_id_grib_api) THEN
662 
663  lnamespace = optio_c(namespace,255)
664  IF (.NOT.c_e(lnamespace))THEN
665  lnamespace = "ls"
666  ENDIF
667 

Generated with Doxygen.