Closed meteorolog90 closed 3 years ago
1.
parameter = as_harp_parameter("mx2t6")
or similar for "mn2t6"as_harp_parameter("ugst", level_type = "height", level = 10)
In theory it should be possible to read grib files with multi-field messages by setting file_format_opts = grib_opts(multi = TRUE)
However, that doesn't appear to work with Rgrib2 from @adeckmyn 's repository, but it does work with Rgrib2 from @harphub.
We don't actually use stepRange for the lead time, but rather the difference between the validDate:validTime and dataDate:dataTime. As long as the second of the two numbers in stepRange is different it's not a problem. However, if you had something like 1-3, 2-3, we can't deal with that at the moment.
About multi grib When multi grib option is used, data is written into database but the warning messages is appears.
fcst_T2m <- read_forecast(
start_date=start,
end_date=end,
fcst_model="ALAEF",
parameter="T2m",
lead_time= seq(0,48,3),
members=seq(0,3,1),
by="12h",
file_path="/data/nwp/products/a-laef_stream",
file_template="A-LAEF_mem_{MBR2}_{YYYY}{MM}{DD}{HH}_surface.grb",
file_format_opts = grib_opts(multi = TRUE),
transformation="interpolate",
transformation_opts=interpolate_opts(stations=stanice,clim_file ="/users/ext005/HARP/2020050400/GEOPOTENCIAL.grb"),
output_file_opts=sqlite_opts(path="/work/users/ext005/sql/forecast/"),
return_data=TRUE,
show_progress =TRUE
)
Reading /users/ext005/HARP/2020050400/GEOPOTENCIAL.grb
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_00_2020081500_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_01_2020081500_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_02_2020081500_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_03_2020081500_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Doing height correction for 2m temperature.
Opening connection to: /work/users/ext005/sql/forecast//ALAEF/2020/08/FCTABLE_T2m_202008_00.sqlite
Adding 'z' to index_cols.
Writing data
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_00_2020081512_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_01_2020081512_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_02_2020081512_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Reading /data/nwp/products/a-laef_stream/A-LAEF_mem_03_2020081512_surface.grb
MULTI: found 1822 message(s) and 1822 field(s).
Doing height correction for 2m temperature.
Opening connection to: /work/users/ext005/sql/forecast//ALAEF/2020/08/FCTABLE_T2m_202008_12.sqlite
Adding 'z' to index_cols.
Writing data
There were 16 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 1: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_00_2020081500_surface.grb".
2: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
3: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 2: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_01_2020081500_surface.grb".
4: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
5: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 3: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_02_2020081500_surface.grb".
6: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
7: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 4: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_03_2020081500_surface.grb".
8: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
9: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 1: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_00_2020081512_surface.grb".
10: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
11: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 2: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_01_2020081512_surface.grb".
12: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
13: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 3: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_02_2020081512_surface.grb".
14: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
15: Problem with `mutate()` input `forecast_data`.
x MULTI is still buggy!
i Input `forecast_data` is `purrr::map2(...)`.
i The error occurred in group 4: file_name = "/data/nwp/products/a-laef_stream/A-LAEF_mem_03_2020081512_surface.grb".
16: In Ginfo.character(filename, IntPar, DblPar, StrPar, rList = as.integer(1:nmessages), ... :
MULTI is still buggy!
When I look at the content written in the database, I do not see an error
It's a warning coming from Rgrib2 to say that it might not be reliable for multi field grib messages. The rest is just traceback. I don't think you need to worry about it, but to be doubly sure it might be worth checking the values are what you expect.
I have problem to read some grib files, so can't do verification with HARP.
Pressure at surface:
Inca wind speed:
I had similar problems with tmax, tmin (attached). I use this list to define the parameters:
Question number two: Is it possible to read multi grib files (using read_forecast function) for HARP verification ?
Inca wind speed multi grib structure:
A-LAEF ensemble grib structure( copy only one part, it is too long ):
i tried it, but can't loop over all stepRange length (reads only first step Range). I solved this problem by breaking it into several parts (using grib_api function grib_copy). Is there a better solution?
Question number three:
In this A-LAEF grib example, as we see, some parameters have two lead time intervals :
Is there a template to read such structured step range (1-2, 2-3, 3-4........)?
attached grib files grib.zip alaef_parts.zip - extract only part, too big for upload
Best regards, Martin