libsim  Versione6.3.0

◆ arrayof_gridinfo_delete()

subroutine, private gridinfo_class::arrayof_gridinfo_delete ( type(arrayof_gridinfo this,
logical, intent(in), optional  nodestroy,
logical, intent(in), optional  nodealloc 
)
private

Destructor for finalizing an array object.

If defined, calls the destructor for every element of the array object; finally it deallocates all the space occupied.

Parametri
thisarray object to be destroyed
thisif 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
[in]nodeallocif provided and .TRUE. , the space reserved for the array is not deallocated, thus the values are retained, while the array pointer is nullified, this means that the caller must have previously assigned the pointer contents thisarray to another pointer to prevent memory leaks

Definizione alla linea 605 del file gridinfo_class.F90.

605  CALL encode_gridinfo(this, tmparr)
606 ENDIF
607 
608 CALL unnormalize_gridinfo(this)
609 
610 CALL time_export_gribapi(this%time, gaid, this%timerange)
611 CALL timerange_export_gribapi(this%timerange, gaid, this%time)
612 CALL level_export_gribapi(this%level, gaid)
613 CALL var_export_gribapi(this%var, gaid)
614 
615 END SUBROUTINE gridinfo_export_gribapi
616 
617 
618 SUBROUTINE time_import_gribapi(this,gaid)
619 TYPE(datetime),INTENT(out) :: this ! datetime object
620 INTEGER,INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to import
621 
622 INTEGER :: EditionNumber, ttimeincr, p2g, p2, unit, status
623 CHARACTER(len=9) :: date
624 CHARACTER(len=10) :: time
625 
626 call grib_get(gaid,'GRIBEditionNumber',editionnumber)
627 
628 IF (editionnumber == 1 .OR. editionnumber == 2) THEN
629 
630  call grib_get(gaid,'dataDate',date )
631  call grib_get(gaid,'dataTime',time(:5) )
632 
633  call init(this,simpledate=date(:8)//time(:4))
634 
635  IF (editionnumber == 2) THEN
636 
637  CALL grib_get(gaid,'typeOfTimeIncrement',ttimeincr,status)
638 ! if analysis-like statistically processed data is encountered, the
639 ! reference time must be shifted to the end of the processing period
640  IF (status == grib_success .AND. ttimeincr == 1) THEN
641  CALL grib_get(gaid,'lengthOfTimeRange',p2g)
642  CALL grib_get(gaid,'indicatorOfUnitForTimeRange',unit)
643  CALL g2_interval_to_second(unit, p2g, p2)
644  this = this + timedelta_new(sec=p2)
645  ELSE IF ((status == grib_success .AND. ttimeincr == 2) .OR. &
646  status /= grib_success) THEN ! usual case
647 ! do nothing
648  ELSE ! valid but unsupported typeOfTimeIncrement
649  CALL l4f_log(l4f_error,'typeOfTimeIncrement '//t2c(ttimeincr)// &
650  ' not supported')
651  CALL raise_error()
652  ENDIF
653  ENDIF
654 
655 else
656  CALL l4f_log(l4f_error,'GribEditionNumber '//t2c(editionnumber)//' not supported')
Functions that return a trimmed CHARACTER representation of the input variable.
Costruttori per le classi datetime e timedelta.

Generated with Doxygen.