2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2016-08-16 16:53:11 +00:00
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
# The section number is always 1 byte and at the 5th byte of each section (so offset=4)
|
|
|
|
|
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 1 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_01 "grib3/section.01.def"; #Originator Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 2 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_02 "grib3/section.02.def"; #Repetitions and Index Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 3 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_03 "grib3/section.03.def"; #Time Domain Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 4 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_04 "grib3/section.04.def"; #Horizontal Domain Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 5 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_05 "grib3/section.05.def"; #Vertical Domain Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 6 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_06 "grib3/section.06.def"; #Generating Process Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 7 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_07 "grib3/section.07.def"; #Observable Property Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2016-08-16 16:53:11 +00:00
|
|
|
|
|
|
|
# Used to mark end of headers. Can be accessed with grib_get_offset()
|
2016-08-17 17:44:44 +00:00
|
|
|
position endOfHeadersMarker;
|
2016-08-16 16:53:11 +00:00
|
|
|
|
2017-05-08 15:21:41 +00:00
|
|
|
meta lengthOfHeaders evaluate(endOfHeadersMarker - startOfHeaders);
|
2016-08-16 16:53:11 +00:00
|
|
|
meta md5Headers md5(startOfHeaders,lengthOfHeaders);
|
|
|
|
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 8 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_08 "grib3/section.08.def"; #Data Representation Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 9 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
2017-05-08 15:21:41 +00:00
|
|
|
template section_09 "grib3/section.09.def"; #Overlay Section
|
2016-08-16 16:53:11 +00:00
|
|
|
}
|
|
|
|
|
2016-08-22 12:44:31 +00:00
|
|
|
lookup[1] sectionNumber(4);
|
2017-05-08 15:21:41 +00:00
|
|
|
if (sectionNumber == 10 or new()){
|
2016-08-16 16:53:11 +00:00
|
|
|
position sectionPosition;
|
|
|
|
template section_10 "grib3/section.10.def"; #Data Section
|
|
|
|
}
|