eccodes/definitions/grib3/sections.def

78 lines
2.3 KiB
Modula-2
Raw Normal View History

2017-05-08 15:14:29 +00:00
# Copyright 2005-2017 ECMWF.
2016-08-16 16:53:11 +00:00
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 1 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_1 "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);
2016-08-16 16:53:11 +00:00
if( sectionNumber == 2 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_2 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 3 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_3 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 4 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_4 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 5 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_5 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 6 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_6 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 7 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_7 "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
2016-08-17 17:44:44 +00:00
meta lengthOfHeaders evaluate( endOfHeadersMarker-startOfHeaders);
2016-08-16 16:53:11 +00:00
meta md5Headers md5(startOfHeaders,lengthOfHeaders);
if(sectionNumber == 8 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_8 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 9 or new() ){
position sectionPosition;
2016-08-19 14:23:54 +00:00
template section_9 "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);
2016-08-16 16:53:11 +00:00
if(sectionNumber == 10 or new() ){
position sectionPosition;
template section_10 "grib3/section.10.def"; #Data Section
}