libsim  Versione6.3.0

◆ gridinfo_import_from_file()

subroutine gridinfo_class::gridinfo_import_from_file ( type(arrayof_gridinfo this,
character(len=*), intent(in)  filename,
character(len=*), intent(in), optional  categoryappend 
)
private

Import an array of gridinfo from a file.

It receives a (possibly unallocated) array of gridinfo objects which will be extended by a number of elements equal to the number of gridded messages/bands found in the file provided and it will be filled with all the data found. In case of error, the gridinfo object will not be allocated, so the success can be tested by checking thisarraysize.

Parametri
thisarray of gridinfo objects which will be allocated/extended and into which data will be imported
[in]filenamename of file to open and import, in the form [driver:]pathname
[in]categoryappendappend this suffix to log4fortran namespace category

Definizione alla linea 921 del file gridinfo_class.F90.

921  CALL grib_set(gaid,'indicatorOfUnitOfTimeRange',unit)
922  CALL grib_set(gaid,'forecastTime',0)
923  CALL code_endoftimeinterval(reftime)
924 ! Successive times processed have same forecast time, start time of
925 ! forecast is incremented
926  CALL grib_set(gaid,'typeOfStatisticalProcessing',this%timerange)
927  CALL grib_set(gaid,'typeOfTimeIncrement',1)
928  CALL grib_set(gaid,'indicatorOfUnitForTimeRange',unit)
929  CALL grib_set(gaid,'lengthOfTimeRange',p2)
930 
931 ! warn about local use
932  IF (this%timerange >= 192) THEN
933  CALL l4f_log(l4f_warn, &
934  'coding in grib2 a nonstandard typeOfStatisticalProcessing '// &
935  t2c(this%timerange))
936  ENDIF
937  ELSE ! bad timerange
938  CALL l4f_log(l4f_error, &
939  'Timerange with 0>p1>p2 cannot be exported in grib2')
940  CALL raise_fatal_error()
941  ENDIF
942  ELSE
943  CALL l4f_log(l4f_error, &
944  'typeOfStatisticalProcessing not supported: '//trim(to_char(this%timerange)))
945  CALL raise_fatal_error()
946  ENDIF
947 
948 ELSE
949  CALL l4f_log(l4f_error,'GribEditionNumber '//t2c(editionnumber)//' not supported')
950  CALL raise_fatal_error()
951 ENDIF
952 
953 CONTAINS
954 
955 ! Explicitely compute and code in grib2 template 4.8 the end of
956 ! overalltimeinterval which is not done automatically by grib_api
957 SUBROUTINE code_endoftimeinterval(endtime)
958 TYPE(datetime),INTENT(in) :: endtime
959 
960 INTEGER :: year, month, day, hour, minute, msec
961 
962 CALL getval(endtime, year=year, month=month, day=day, &
963  hour=hour, minute=minute, msec=msec)
964  CALL grib_set(gaid,'yearOfEndOfOverallTimeInterval',year)
965  CALL grib_set(gaid,'monthOfEndOfOverallTimeInterval',month)
966  CALL grib_set(gaid,'dayOfEndOfOverallTimeInterval',day)
967  CALL grib_set(gaid,'hourOfEndOfOverallTimeInterval',hour)
968  CALL grib_set(gaid,'minuteOfEndOfOverallTimeInterval',minute)
969  CALL grib_set(gaid,'secondOfEndOfOverallTimeInterval',msec/1000)
970 
971 END SUBROUTINE code_endoftimeinterval
972 
973 END SUBROUTINE timerange_export_gribapi
974 
Functions that return a trimmed CHARACTER representation of the input variable.
Restituiscono il valore dell'oggetto in forma di stringa stampabile.
Restituiscono il valore dell'oggetto nella forma desiderata.

Generated with Doxygen.