ECC-1018: Instead of a variable-length ascii array use 1-byte integers

This commit is contained in:
Shahram Najm 2019-12-05 15:38:07 +00:00
parent 417a2c7fe8
commit 9bd1fdc18b
3 changed files with 14 additions and 55 deletions

View File

@ -1,11 +1,4 @@
## 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;
ascii[4] identifier;

View File

@ -1,11 +1,4 @@
# 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 ;
@ -27,23 +20,12 @@ codetable[1] indicatorOfTypeOfLevel 'grib1/3.table';
codetable[2] heightPressureEtcOfLevels 'grib1/3.table';
alias ls.levelType=indicatorOfTypeOfLevel;
# Year of century
# NOTE 6 NOT FOUND
unsigned[1] yearOfCentury ;
# Month
unsigned[1] month ;
# Day
unsigned[1] day;
# Hour
unsigned[1] hour ;
# Minute
unsigned[1] minute ;
transient second = 0;
meta dataDate budgdate(yearOfCentury,month,day);
alias ls.date=dataDate;
@ -51,21 +33,16 @@ meta dataTime time(hour,minute,second);
alias ls.time=dataTime;
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';
# P1 - Period of time
# (number of time units)
# P1 - Period of time (number of time units)
unsigned[1] periodOfTime ;
alias P1 = periodOfTime ;
alias P1 = periodOfTime ;
# P2 - Period of time
# (number of time units)
# P2 - Period of time
unsigned[1] periodOfTimeIntervals ;
alias P2 = periodOfTimeIntervals ;
alias P2 = periodOfTimeIntervals ;
codetable[1] timeRangeIndicator 'grib1/5.table';

View File

@ -1,18 +1,9 @@
# 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 ;
unsigned[1] reserved1=0 : hidden;
flags[1] missingDataFlag 'grib1/1.table';
unsigned[1] numberOfBytesPerInteger=4;
unsigned[2] reserved=0 : hidden ;
@ -26,9 +17,7 @@ unsigned[3] numberOfIntegers=0;
alias numberOfInts=numberOfIntegers ;
unsigned[3] numberOfLogicals ;
unsigned[3] numberOfReservedBytes ;
unsigned[4] reserved=0 : hidden;
unsigned[4] reserved=0 : hidden;
unsigned[1] reserved=0 : hidden;
@ -36,18 +25,18 @@ unsigned[1] reserved=0 : hidden;
ibmfloat floatValues[numberOfFloats];
alias floatVal=floatValues;
if(numberOfIntegers) {
if (numberOfIntegers) {
signed[4] integerValues[numberOfIntegers];
}
#if(numberOfBytesPerInteger == 1) { signed[1] integerValues[numberOfIntegers]; }
#if(numberOfBytesPerInteger == 2) { signed[2] integerValues[numberOfIntegers]; }
#if(numberOfBytesPerInteger == 3) { signed[3] integerValues[numberOfIntegers]; }
#if(numberOfBytesPerInteger == 4) { signed[4] integerValues[numberOfIntegers]; }
charValues list(numberOfCharacters) {
ascii[1] char;
# TODO: temporary solution for variable-length list of ascii
#charValues list(numberOfCharacters) {
# ascii[1] char;
#}
if (numberOfCharacters) {
unsigned[1] charValues[numberOfCharacters];
alias charVal=charValues;
}
alias charVal=charValues;
# Final padding
section_padding padding;