mirror of https://github.com/ecmwf/eccodes.git
ECC-1018: Instead of a variable-length ascii array use 1-byte integers
This commit is contained in:
parent
417a2c7fe8
commit
9bd1fdc18b
|
@ -1,11 +1,4 @@
|
||||||
## Copyright 2005-2019 ECMWF.
|
## Copyright 2005-2019 ECMWF.
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
position startOfHeaders;
|
position startOfHeaders;
|
||||||
ascii[4] identifier;
|
ascii[4] identifier;
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
# Copyright 2005-2019 ECMWF.
|
# Copyright 2005-2019 ECMWF.
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
section_length[3] section1Length ;
|
section_length[3] section1Length ;
|
||||||
|
|
||||||
|
@ -27,23 +20,12 @@ codetable[1] indicatorOfTypeOfLevel 'grib1/3.table';
|
||||||
codetable[2] heightPressureEtcOfLevels 'grib1/3.table';
|
codetable[2] heightPressureEtcOfLevels 'grib1/3.table';
|
||||||
alias ls.levelType=indicatorOfTypeOfLevel;
|
alias ls.levelType=indicatorOfTypeOfLevel;
|
||||||
|
|
||||||
# Year of century
|
|
||||||
# NOTE 6 NOT FOUND
|
|
||||||
unsigned[1] yearOfCentury ;
|
unsigned[1] yearOfCentury ;
|
||||||
|
|
||||||
# Month
|
|
||||||
unsigned[1] month ;
|
unsigned[1] month ;
|
||||||
|
|
||||||
# Day
|
|
||||||
unsigned[1] day;
|
unsigned[1] day;
|
||||||
|
|
||||||
# Hour
|
|
||||||
unsigned[1] hour ;
|
unsigned[1] hour ;
|
||||||
|
|
||||||
# Minute
|
|
||||||
unsigned[1] minute ;
|
unsigned[1] minute ;
|
||||||
|
|
||||||
|
|
||||||
transient second = 0;
|
transient second = 0;
|
||||||
meta dataDate budgdate(yearOfCentury,month,day);
|
meta dataDate budgdate(yearOfCentury,month,day);
|
||||||
alias ls.date=dataDate;
|
alias ls.date=dataDate;
|
||||||
|
@ -51,21 +33,16 @@ meta dataTime time(hour,minute,second);
|
||||||
alias ls.time=dataTime;
|
alias ls.time=dataTime;
|
||||||
meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific;
|
meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific;
|
||||||
|
|
||||||
|
# Indicator of unit of time range
|
||||||
# Indicator of unit of time range
|
|
||||||
codetable[1] indicatorOfUnitOfTimeRange 'grib1/4.table';
|
codetable[1] indicatorOfUnitOfTimeRange 'grib1/4.table';
|
||||||
|
|
||||||
# P1 - Period of time
|
# P1 - Period of time (number of time units)
|
||||||
# (number of time units)
|
|
||||||
unsigned[1] periodOfTime ;
|
unsigned[1] periodOfTime ;
|
||||||
|
alias P1 = periodOfTime ;
|
||||||
|
|
||||||
alias P1 = periodOfTime ;
|
# P2 - Period of time
|
||||||
|
|
||||||
# P2 - Period of time
|
|
||||||
# (number of time units)
|
|
||||||
unsigned[1] periodOfTimeIntervals ;
|
unsigned[1] periodOfTimeIntervals ;
|
||||||
|
alias P2 = periodOfTimeIntervals ;
|
||||||
alias P2 = periodOfTimeIntervals ;
|
|
||||||
|
|
||||||
codetable[1] timeRangeIndicator 'grib1/5.table';
|
codetable[1] timeRangeIndicator 'grib1/5.table';
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,9 @@
|
||||||
# Copyright 2005-2019 ECMWF.
|
# Copyright 2005-2019 ECMWF.
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
section_length[3] section4Length ;
|
section_length[3] section4Length ;
|
||||||
|
|
||||||
unsigned[1] reserved1=0 : hidden;
|
unsigned[1] reserved1=0 : hidden;
|
||||||
|
|
||||||
flags[1] missingDataFlag 'grib1/1.table';
|
flags[1] missingDataFlag 'grib1/1.table';
|
||||||
|
|
||||||
unsigned[1] numberOfBytesPerInteger=4;
|
unsigned[1] numberOfBytesPerInteger=4;
|
||||||
|
|
||||||
unsigned[2] reserved=0 : hidden ;
|
unsigned[2] reserved=0 : hidden ;
|
||||||
|
@ -26,9 +17,7 @@ unsigned[3] numberOfIntegers=0;
|
||||||
alias numberOfInts=numberOfIntegers ;
|
alias numberOfInts=numberOfIntegers ;
|
||||||
|
|
||||||
unsigned[3] numberOfLogicals ;
|
unsigned[3] numberOfLogicals ;
|
||||||
|
|
||||||
unsigned[3] numberOfReservedBytes ;
|
unsigned[3] numberOfReservedBytes ;
|
||||||
|
|
||||||
unsigned[4] reserved=0 : hidden;
|
unsigned[4] reserved=0 : hidden;
|
||||||
unsigned[4] reserved=0 : hidden;
|
unsigned[4] reserved=0 : hidden;
|
||||||
unsigned[1] reserved=0 : hidden;
|
unsigned[1] reserved=0 : hidden;
|
||||||
|
@ -36,18 +25,18 @@ unsigned[1] reserved=0 : hidden;
|
||||||
ibmfloat floatValues[numberOfFloats];
|
ibmfloat floatValues[numberOfFloats];
|
||||||
alias floatVal=floatValues;
|
alias floatVal=floatValues;
|
||||||
|
|
||||||
if(numberOfIntegers) {
|
if (numberOfIntegers) {
|
||||||
signed[4] integerValues[numberOfIntegers];
|
signed[4] integerValues[numberOfIntegers];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if(numberOfBytesPerInteger == 1) { signed[1] integerValues[numberOfIntegers]; }
|
# TODO: temporary solution for variable-length list of ascii
|
||||||
#if(numberOfBytesPerInteger == 2) { signed[2] integerValues[numberOfIntegers]; }
|
#charValues list(numberOfCharacters) {
|
||||||
#if(numberOfBytesPerInteger == 3) { signed[3] integerValues[numberOfIntegers]; }
|
# ascii[1] char;
|
||||||
#if(numberOfBytesPerInteger == 4) { signed[4] integerValues[numberOfIntegers]; }
|
#}
|
||||||
|
if (numberOfCharacters) {
|
||||||
charValues list(numberOfCharacters) {
|
unsigned[1] charValues[numberOfCharacters];
|
||||||
ascii[1] char;
|
alias charVal=charValues;
|
||||||
}
|
}
|
||||||
alias charVal=charValues;
|
|
||||||
|
|
||||||
|
# Final padding
|
||||||
section_padding padding;
|
section_padding padding;
|
||||||
|
|
Loading…
Reference in New Issue