libsim  Versione7.2.3

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

589 
590 TYPE(conv_func) :: c_func
591 REAL,ALLOCATABLE :: tmparr(:,:)
592 
593 ! convert variable and values to the correct edition if required
594 CALL volgrid6d_var_normalize(this%var, c_func, grid_id_new(grib_api_id=gaid))
595 IF (this%var == volgrid6d_var_miss) THEN
596  CALL l4f_log(l4f_error, &
597  'A suitable variable has not been found in table when converting template')
598  CALL raise_error()
599 ENDIF
600 IF (c_func /= conv_func_miss) THEN ! convert values as well
601  tmparr = decode_gridinfo(this) ! f2003 implicit allocation
602  CALL compute(c_func, tmparr)
603  CALL encode_gridinfo(this, tmparr)
604 ENDIF
605 
606 CALL unnormalize_gridinfo(this)
607 
608 CALL time_export_gribapi(this%time, gaid, this%timerange)
609 CALL timerange_export_gribapi(this%timerange, gaid, this%time)
610 CALL level_export_gribapi(this%level, gaid)
611 CALL var_export_gribapi(this%var, gaid)
612 
613 END SUBROUTINE gridinfo_export_gribapi
614 
615 
616 SUBROUTINE time_import_gribapi(this,gaid)
617 TYPE(datetime),INTENT(out) :: this ! datetime object
618 INTEGER,INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to import
619 
620 INTEGER :: EditionNumber, ttimeincr, tprocdata, centre, p2g, p2, unit, status
621 CHARACTER(len=9) :: date
622 CHARACTER(len=10) :: time
623 
624 CALL grib_get(gaid,'GRIBEditionNumber',editionnumber)
625 
626 IF (editionnumber == 1 .OR. editionnumber == 2) THEN
627 
628  CALL grib_get(gaid,'dataDate',date )
629  CALL grib_get(gaid,'dataTime',time(:5) )
630 
631  CALL init(this,simpledate=date(:8)//time(:4))
632 
633  IF (editionnumber == 2) THEN
634 
635  CALL grib_get(gaid,'typeOfProcessedData',tprocdata,status)
636  CALL grib_get(gaid,'typeOfTimeIncrement',ttimeincr,status)
637  IF (ttimeincr == 255) ttimeincr = 2 ! fix some MeteosWiss data
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

Generated with Doxygen.