libsim  Versione8.0.0

◆ gridinfo_export_to_file()

subroutine gridinfo_export_to_file ( type(arrayof_gridinfo)  this,
character(len=*), intent(in)  filename,
character(len=*), intent(in), optional  categoryappend 
)

Export an arrayof_gridinfo object to a file.

It receives an arrayof_gridinfo object which will be exported to the given file. The driver for writing to file is chosen according to the gaid associated to the first gridinfo element, and it must be the same for all the elements.

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

Definizione alla linea 1016 del file gridinfo_class.F90.

1016 INTEGER :: year, month, day, hour, minute, msec
1017 
1018 CALL getval(endtime, year=year, month=month, day=day, &
1019  hour=hour, minute=minute, msec=msec)
1020  CALL grib_set(gaid,'yearOfEndOfOverallTimeInterval',year)
1021  CALL grib_set(gaid,'monthOfEndOfOverallTimeInterval',month)
1022  CALL grib_set(gaid,'dayOfEndOfOverallTimeInterval',day)
1023  CALL grib_set(gaid,'hourOfEndOfOverallTimeInterval',hour)
1024  CALL grib_set(gaid,'minuteOfEndOfOverallTimeInterval',minute)
1025  CALL grib_set(gaid,'secondOfEndOfOverallTimeInterval',msec/1000)
1026 
1027 END SUBROUTINE code_endoftimeinterval
1028 
1029 END SUBROUTINE timerange_export_gribapi
1030 
1031 
1032 SUBROUTINE var_import_gribapi(this, gaid)
1033 TYPE(volgrid6d_var),INTENT(out) :: this ! volgrid6d_var object
1034 INTEGER,INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to import
1035 
1036 INTEGER :: EditionNumber, centre, discipline, category, number
1037 
1038 call grib_get(gaid,'GRIBEditionNumber',editionnumber)
1039 
1040 if (editionnumber == 1) then
1041 
1042  call grib_get(gaid,'centre',centre)
1043  call grib_get(gaid,'gribTablesVersionNo',category)
1044  call grib_get(gaid,'indicatorOfParameter',number)
1045 
1046  call init(this, centre, category, number)
1047 
1048 else if (editionnumber == 2) then
1049 
1050  call grib_get(gaid,'centre',centre)
1051  call grib_get(gaid,'discipline',discipline)
1052  call grib_get(gaid,'parameterCategory',category)
1053  call grib_get(gaid,'parameterNumber',number)
1054 
1055  call init(this, centre, category, number, discipline)
1056 
1057 else
1058 
1059  CALL l4f_log(l4f_error,'GribEditionNumber '//t2c(editionnumber)//' not supported')
1060  CALL raise_error()
1061 
1062 endif
1063 
1064 END SUBROUTINE var_import_gribapi
1065 
1066 
1067 SUBROUTINE var_export_gribapi(this, gaid)
1068 TYPE(volgrid6d_var),INTENT(in) :: this ! volgrid6d_var object
1069 INTEGER,INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to export
1070 
1071 INTEGER ::EditionNumber
1072 
1073 call grib_get(gaid,'GRIBEditionNumber',editionnumber)
1074 
1075 if (editionnumber == 1) then
1076 
1077  IF (this%centre /= 255) & ! if centre missing (coming from bufr), keep template
1078  CALL grib_set(gaid,'centre',this%centre)
1079  CALL grib_set(gaid,'gribTablesVersionNo',this%category)

Generated with Doxygen.